Note. Boxplots display the interquartile range (IQR, center box), and the whiskers extend 1.5*IQR from the lower and upper hinge. The white point indicates the mean and the white center line indicates the median.




Data Preparation

In an initial preparatory step, we import the data into the R project environment and prepare the variables for further processing and later analyses.

Data Import

The data were collected using two different survey tools. For the study with sojourners (Study 1: worker) we used the survey platform Qualtrics XM, whereas the studies with international students (Study 2: student), and the international medical professionals (Study 3: medical) were conducted using the survey framework FormR. This means that the datasets had inconsistent file formats and naming conventions. For the Qualtrics study we pre-processed some variables to ease the import process (for the syntax files see the SPSS files in ‘data/S1_Workers/processed/cleaned’ and for the raw data files see ‘data/S1_Workers/raw’). For the two other studies, we import the raw csv files from their respective folders.

# Load variable name lookup table
varNames <- readxl::read_excel("preregistration/varNames.xlsx")

# rename function
reNam <- function(data = NA, names = varNames, study = "S1", survey = "pre") {
  # for testing
  # data = dtS1$raw.pre
  # names = varNames
  # study = "S1"
  # survey = "pre"
  
  var <- paste0("survey", study)
  varNamOld <- paste0("varNam", study)
  
  nameTbl <- names %>%
    filter((!!sym(var)) == survey) %>%
    select(varNam, varNamOld = (!!sym(varNamOld)))
  
  data.table::setnames(data, as.character(nameTbl$varNamOld), as.character(nameTbl$varNam), skip_absent=TRUE)
  
  return(data)
}

# workers
# initial data cleaning was done in SPSS (syntax files are available in "")
dtS1 <- list(
  raw.pre = read_spss("data/S1_Workers/processed/cleaned/MT - Pre-Measure - 06-15-2018.sav") %>% 
    reNam(data = ., names = varNames, study = "S1", survey = "pre"),
  raw.post = read_spss("data/S1_Workers/processed/cleaned/MT - Post-Measure - 06-15-2018.sav") %>% 
    reNam(data = ., names = varNames, study = "S1", survey = "post"),
  raw.morning = read_spss("data/S1_Workers/processed/cleaned/MT - Morning - 06-15-2018.sav") %>% 
    reNam(data = ., names = varNames, study = "S1", survey = "daily"),
  raw.afternoon = read_spss("data/S1_Workers/processed/cleaned/MT - Afternoon - 06-15-2018.sav") %>% 
    reNam(data = ., names = varNames, study = "S1", survey = "daily")
)

# students
dtS2 <- list(
  raw.pre = read.csv(file = "data/S2_Students/raw/AOTS_Pre.csv", header = T, sep = ",") %>% 
    reNam(data = ., names = varNames, study = "S2", survey = "pre"),
  raw.post = read.csv(file = "data/S2_Students/raw/AOTS_Post.csv", header = T, sep = ",") %>% 
    reNam(data = ., names = varNames, study = "S2", survey = "post"),
  raw.daily = read.csv(file = "data/S2_Students/raw/AOTS_Daily.csv", header = T, sep = ",") %>% 
    reNam(data = ., names = varNames, study = "S2", survey = "daily")
)

# young medical professionals
dtS3 <- list(
  raw.eligibility = read.csv("data/S3_Medical/raw/AOTM_Eligibility.csv") %>% 
    reNam(data = ., names = varNames, study = "S3", survey = "pre_entry"), # works but should be 'survey = "pre_elig"'
  raw.pre = read.csv("data/S3_Medical/raw/AOTM_Pre.csv") %>% 
    reNam(data = ., names = varNames, study = "S3", survey = "pre_entry"),
  raw.post = read.csv("data/S3_Medical/raw/AOTM_Post.csv") %>% 
    reNam(data = ., names = varNames, study = "S3", survey = "post"),
  raw.daily = read.csv("data/S3_Medical/raw/AOTM_Daily.csv") %>% 
    reNam(data = ., names = varNames, study = "S3", survey = "daily")
)

# # FROM INITIAL VAR NAME EXPORT [LEGACY]
# # export var names
# S1Nam <- rbind(
#   data.frame(
#     study = "S1",
#     survey = "pre",
#     varNam = names(dtS1$raw.pre)
#   ),
#   data.frame(
#     study = "S1",
#     survey = "daily",
#     varNam = names(dtS1$raw.afternoon)
#   ),
#   data.frame(
#     study = "S1",
#     survey = "post",
#     varNam = names(dtS1$raw.post)
#   )
# )
# S2Nam <- rbind(
#   data.frame(
#     study = "S2",
#     survey = "pre",
#     varNam = names(dtS2$raw.pre)
#   ),
#   data.frame(
#     study = "S2",
#     survey = "daily",
#     varNam = names(dtS2$raw.daily)
#   ),
#   data.frame(
#     study = "S2",
#     survey = "post",
#     varNam = names(dtS2$raw.post)
#   )
# )
# S3Nam <- rbind(
#   data.frame(
#     study = "S3",
#     survey = "pre_elig",
#     varNam = names(dtS3$raw.eligibility)
#   ),
#   data.frame(
#     study = "S3",
#     survey = "pre_entry",
#     varNam = names(dtS3$raw.pre)
#   ),
#   data.frame(
#     study = "S3",
#     survey = "daily",
#     varNam = names(dtS3$raw.daily)
#   ),
#   data.frame(
#     study = "S3",
#     survey = "post",
#     varNam = names(dtS3$raw.post)
#   )
# )
# write.csv(
#   x = rbind(
#     S1Nam,
#     S2Nam,
#     S3Nam
#   ),
#   file = "preregistration/varNames.csv"
# )

Data Cleaning & Data Exclusions

Study 1

For the sojourner sample data was collected in four separate surveys: (1) the pre-measurement, (2) the daily morning survey, (3) the daily afternoon survey, as well as (4) a post-measurement. We combine the four individual surveys into one cohesive dataframe and drop superfluous variables that are not relevant to the analyses relevant here. We then format the time and date variables and add person- and measurement indices (for easy and meaningful addressing of the data). We also exclude our own test data.
Note: All data preparation steps are saved in the ‘dtS1’ list.

# Create reduced data sets for morning and afternoon
dat.mo <- dtS1$raw.morning %>%
  select(-starts_with("t_"))
#setdiff(names(dtS1$raw.morning), names(dat.mo))
dat.mo$daytime <- "morning"

dat.af <- dtS1$raw.afternoon %>%
  select(-starts_with("t_"))
dat.af$daytime <- "afternoon"

# merge morning and afternoon measurements with indicator [+ clean up]
daily.dat <- plyr::rbind.fill(dat.mo, dat.af)
daily.dat <- daily.dat[daily.dat$last_outside_referrer != 55951, ]
dtS1$daily <- daily.dat
rm(dat.mo, dat.af, daily.dat)

# reduced data set for pre measurement
dat.pre.red <- dtS1$raw.pre %>%
  select(-starts_with("t_"))
names(dat.pre.red) <- paste(names(dat.pre.red), "pre", sep = ".")

# merge with daily data [+ clean up]
df.pre <- merge(
  x = dtS1$daily,
  y = dat.pre.red,
  by.x = "last_outside_referrer",
  by.y = "platformId.pre",
  all = T
)

# adjust duplicate names to fit to indicate daily or pre measurement
names(df.pre) <- gsub("[[:punct:]]x", ".daily", names(df.pre))
names(df.pre) <- gsub("[[:punct:]]y", ".pre", names(df.pre))

# reduced data set for post-measurement
dat.post.red <- dtS1$raw.post %>%
  select(-starts_with("t_"))
names(dat.post.red) <- paste(names(dat.post.red), "post", sep = ".")

# merge post measurement with pre- and daily data
df <- merge(
  x = df.pre,
  y = dat.post.red,
  by.x = "last_outside_referrer",
  by.y = "last_outside_referrer.post",
  all = T
)

# adjust duplicate names to indicate pre or post
names(df) <- gsub("[[:punct:]]x", ".pre", names(df))
names(df) <- gsub("[[:punct:]]y", ".post", names(df))

# add to list
dtS1$combined <- df
rm(df, df.pre, dat.post.red, dat.pre.red)

# create data frame with cleaned data
df <- dtS1$combined %>%
  filter(
    Finished.pre == 1,
    Finished == 1,
    !is.na(last_outside_referrer)
  )

# add running number as measurement ID within participants
df$measureID <- data.table::rowidv(df, cols = c("last_outside_referrer"))

dtS1$clean <- df

# clean up
rm(df)

# Export reduced Data
# write.csv(dtS1$clean, "data/processed/MT_clean-merged_07-05-2018.csv", row.names = F)
# save(dtS1$clean, file = "data/processed/MT_clean-merged_07-05-2018.RData")

Study 2

For the student sample data were, similarly, collected in three separate surveys: (1) the pre-measurement, (2) the daily survey sent out at lunch and dinner time, and (3) a post-measurement. We combine the three individual surveys into one large dataframe and drop superfluous variables that are not relevant to the analyses relevant here. We exclude our own test data as well as one participant who entered the study twice (but gave different responses during the pre-measurement). We also reformat missing values and format core ID variables.
Note: All data preparation steps are saved in the ‘dtS2’ list.

# our own test IDs
ownIDs <- c(
  "beautifulLionfishXXXR5rcgVBzGu8hPvOqrK8UBJBw4owvi9nfRFSFu3lMzYhE",
  "niceDogoXXXmB8JI5SFu78SF3DVof84mGUPPNUr14p2HYFTtp31a6D1OwAzM6F-K",
  "amusedQuailXXXmhuc_fpTp8vPkMwDH1BzjaH1d1kHSO1bsPEfsnaEYk4WeVBfPi",
  "juwGAbtXX0_1kmZtSVqKh3PGaHOICqUyU4iBkrT3nDsI_uifuD1gzKcZerxaM5FL"
)

# Prepare dfs for Cleaning
df.pre <- dtS2$raw.pre %>%
  mutate(across(where(is.character), na_if, "")) %>%
  mutate(across(where(is.character), na_if, "NA")) %>%
  filter(!is.na(ended)) %>% # remove all who did not finish
  filter(!email %in% .$email[duplicated(.$email)]) %>% # remove all who did the pre questionnaire multiple times (b/c inconsistent ratings scales)
  filter(!ResponseId %in% ownIDs) %>% # remove our own test
  mutate(ResponseId = as.character(ResponseId)) # turn factor into character strings (probably just precaution)
names(df.pre) <- paste(names(df.pre), "pre", sep = ".")

df.post <- dtS2$raw.post %>%
  mutate(across(where(is.character), na_if, "")) %>%
  mutate(across(where(is.character), na_if, "NA")) %>%
  filter(!is.na(ResponseId)) %>% # remove own test runs
  filter(!ResponseId %in% ownIDs) %>% # remove our own test
  filter(ResponseId %in% df.pre$ResponseId) %>% # remove anyone who wasn't in the pre
  filter(!is.na(ended)) %>% # remove all who never finished
  filter(!ResponseId %in% .$ResponseId[duplicated(.$ResponseId)]) %>% # remove all duplicate ResponseIds
  mutate(ResponseId = as.character(ResponseId)) # turn factor into character strings (probably just precaution)
names(df.post) <- paste(names(df.post), "post", sep = ".")

df.daily <- dtS2$raw.daily %>%
  mutate(across(where(is.character), na_if, "")) %>%
  mutate(across(where(is.character), na_if, "NA")) %>%
  filter(!ResponseId %in% ownIDs) %>% # remove our own test
  filter(ResponseId %in% df.pre$ResponseId) %>% # remove anyone who wasn't in the pre
  filter(!is.na(ended)) %>% # remove all who never finished
  mutate(ResponseId = as.character(ResponseId)) # turn factor into character strings (probably just precaution)

# merge daily with pre
dfPreDaily <- merge(
  x = df.daily,
  y = df.pre,
  by.x = "ResponseId",
  by.y = "ResponseId.pre", 
  suffixes = c(".daily", ".pre"),
  all = FALSE
)

# merge daily with post
dfCombined <- merge(
  x = dfPreDaily,
  y = df.post,
  by.x = "ResponseId",
  by.y = "ResponseId.post", 
  suffixes = c(".pre", ".post"),
  all = FALSE
)

# add to list
dtS2$clean <- dfCombined

# clean up workspace
rm(df.pre, df.daily, df.post, dfPreDaily, dfCombined, ownIDs)

Study 3

For the medical professionals sample data was, again, collected in three separate surveys: (1) the pre-measurement, (2) the daily survey sent out at lunch and dinner time, and (3) a post-measurement. We combine the three individual surveys into one large dataframe. We exclude our own test data. We also reformat missing values and format core ID variables.
Note: All data preparation steps are saved in the ‘dtS3’ list.

# our own test IDs
ownIDs <- c(
  "test_LeonieXXXSklxecPLW0-FBPM4796o3pUwUhAY5jb9KGw8jQsKxWmGpa1Jiy", 
  "test_MaxXXXtOp_5dTNefIq0yKXtXt2IN6eEKxeHoPY9mlyvdsqPpLp1B0NGg4UL",
  "test_JannisXXXBsNqk62fOpX6chbd2tMWPptUdjjnhAqnQ3uBqckZ7gLIEoPlfZ",
  "quaintLeopardCatXXXAJ9cfSj-_SZLwNwMDxv_xv_iyr1Bg5YFLTlYdrjW0UXZY",
  "blue-eyedIndianElephantXXXLf5zPMpQCDGS3umFzIj-YVky7ivTItvvozW49m"
)

# Prepare dfs for Cleaning
df.pre <- dtS3$raw.pre %>%
  mutate(across(where(is.character), na_if, "")) %>%
  mutate(across(where(is.character), na_if, "NA")) %>%
  filter(!is.na(ended)) %>% # remove all who did not finish
  filter(!ResponseId %in% ownIDs) %>% # remove our own test
  mutate(ResponseId = as.character(ResponseId)) # turn factor into character strings (probably just precaution)
names(df.pre) <- paste(names(df.pre), "pre", sep = ".")

df.post <- dtS3$raw.post %>%
  mutate(across(where(is.character), na_if, "")) %>%
  mutate(across(where(is.character), na_if, "NA")) %>%
  filter(!is.na(ResponseId)) %>% # remove own test runs
  filter(!ResponseId %in% ownIDs) %>% # remove our own test
  filter(ResponseId %in% df.pre$ResponseId) %>% # remove anyone who wasn't in the pre
  #filter(!is.na(ended)) %>% # remove all who never finished [disabled because only relevant if data is missing]
  filter(!ResponseId %in% .$ResponseId[duplicated(.$ResponseId)]) %>% # remove all duplicate ResponseIds
  mutate(ResponseId = as.character(ResponseId)) # turn factor into character strings (probably just precaution)
names(df.post) <- paste(names(df.post), "post", sep = ".")

df.daily <- dtS3$raw.daily %>%
  mutate(across(where(is.character), na_if, "")) %>%
  mutate(across(where(is.character), na_if, "NA")) %>%
  filter(!ResponseId %in% ownIDs) %>% # remove our own test
  filter(ResponseId %in% df.pre$ResponseId) %>% # remove anyone who wasn't in the pre
  #filter(!is.na(ended)) %>% # remove all who never finished [disabled because only relevant if data is missing]
  mutate(ResponseId = as.character(ResponseId)) # turn factor into character strings (probably just precaution)

# merge daily with pre
dfPreDaily <- merge(
  x = df.daily,
  y = df.pre,
  by.x = "ResponseId",
  by.y = "ResponseId.pre", 
  suffixes = c(".daily", ".pre"),
  all = F
)

# merge daily with post
dfCombined <- merge(
  x = dfPreDaily,
  y = df.post,
  by.x = "ResponseId",
  by.y = "ResponseId.post", 
  suffixes = c(".pre", ".post"),
  all = F
)

# add to list
dtS3$clean <- dfCombined

# clean up workspace
rm(df.pre, df.daily, df.post, dfPreDaily, dfCombined, ownIDs)

Calculate needed transformations

Study 1

For the worker sample, the data transformation stage had three main aims:

  1. We first corrected time indicators within the surveys. In some cases participants completed their daily diary surveys for the afternoon after midnight. In these cases the measurement still is in reference to the previous day and is indicated in the corrected variable.
  2. We then created indices of scales. Some indices were multi-item scales while some indices combine equivalent measurement for different situational circumstances (e.g., competence perceptions after interactions and at measurement occasions without interactions).
  3. Finally, we calculated several basic participant summaries (averages across all measurement occasions).
df <- dtS1$clean

# Correct date_period ()
df <- df %>%
  mutate(
    startDate = as.Date(created),
    startTime = format(as.POSIXct(created), format = "%H:%M:%S")
  )
  
# order time
# df$TID <- factor(df$date_period, levels = unique(dtS3$raw.daily$date_period))
# df$TIDnum <- as.numeric(df$TID) # get numeric TID
df <- df %>%
  mutate(
    PID = as.numeric(factor(last_outside_referrer))
  )

# Time and Date Variables
df <- df %>%
  mutate(
    TID = measureID - 1,
    # time ID with t0 = 0 for meaningfull intercept interpretations
    date = substr(created, 1, 10),
    # awkward way of extracting date (best converted to )
    time = substr(created, 12, 19),
    # awkward way of extracting time
    daynum = as.numeric(factor(dateQualtrics)),
    # all days as numeric for ordering
    daycor = ifelse(
      daytime == "morning" &
        period_to_seconds(hms(time)) < period_to_seconds(hms("12:00:00")) |
        daytime == "afternoon" &
          period_to_seconds(hms(time)) < period_to_seconds(hms("19:00:00")),
      daynum - 1,
      daynum
    ),
    daycorTest = ifelse(
      daytime == "morning" &
        period_to_seconds(hms(time)) < period_to_seconds(hms("12:00:00")) |
        daytime == "afternoon" &
          period_to_seconds(hms(time)) < period_to_seconds(hms("19:00:00")),
      1,
      0
    ),
    # correctly identify which date the questionnaire is about
    daycor.lead = sprintf("%02d", daycor),
    daytime.lt = ifelse(daytime == "morning", "a", "b"),
    # morning / afternoon to a / b
    day_time = paste(daycor.lead, daytime.lt, sep = "_"),
    # combine day id with morning / afternoon
    ResponseId = as.numeric(factor(day_time)),
    # day and time identifier as numeric id
    SubTime = chron::times(time.0),
    time.daily = as.character(time),
    PPDate = as.Date(df$dateQualtrics),
    number = replace_na(ContactNum, 0),
    NonDutchNum = replace_na(NonDutchNum, 0)
  )

# remove seconds from afternoon time
df$SubTime[df$daytime == "afternoon"] <- paste0(substring(as.character(df$time.0[df$daytime == "afternoon"]), 4, 8), ":00")
df$time.daily[df$daytime == "afternoon" &
  !is.na(df$time.daily != "<NA>")] <- paste0(substring(as.character(df$time.daily[df$daytime == "afternoon" &
  !is.na(df$time.daily != "<NA>")]), 4, 8), ":00")

# Correct morning / afternoon date where survey was collected the day after to indicate the correct date that was targeted
df$PPDate[df$SubTime < "11:50:00" &
  df$daytime == "morning"] <- df$PPDate[df$SubTime < "11:50:00" &
  df$daytime == "morning"] - 1
df$PPDate[df$SubTime < "18:50:00" &
  df$daytime == "afternoon"] <- df$PPDate[df$SubTime < "18:50:00" &
  df$daytime == "afternoon"] - 1

# Make time IDs consistent with later studies
df$TID <- paste(df$PPDate, str_to_title(df$daytime))
df$TIDnum <- as.numeric(factor(df$TID %>% gsub(" Morning", "-A", .) %>% gsub(" Afternoon", "-B", .)))

df <- df %>%
  rowwise() %>%
  mutate(
    InteractionDum = sum(IntergroupContact, IngroupContact, na.rm = FALSE),
    InteractionDum = if_else(InteractionDum > 0, 1, InteractionDum),
    alertness = sum(alertness1, alertness2, na.rm = TRUE),
    calmness = sum(calmness1, calmness2, na.rm = TRUE),
    valence = sum(valence1, valence2, na.rm = TRUE)
  ) %>%
  ungroup()

# Need scales
df$keyMotiveFulfilled <- rowSums(df[, c("KeyNeedFulfillment", "DaytimeNeedFulfillment")], na.rm = T)
df$autonomy.daily.all <- rowSums(df[, c("autonomy_Int", "autonomy_NoInt")], na.rm = T)
df$competence.daily.all <- rowSums(df[, c("competence_Int", "competence_NoInt")], na.rm = T)
# cor(df$relatednessOther, df$relatedness_self_1,use="complete.obs")
df$relatedness.daily.all <- rowMeans(df[, c(
  "relatednessOther",
  "relatednessSelf",
  "relatednessNoInteraction"
)], na.rm = T)

pairs.panels.new(
  df[c("relatednessSelf", "relatednessOther")],
  labels = c(
    "I shared information about myself.",
    "X shared information about themselves."
  )
)

df$relatedness <- rowMeans(df[, c("relatednessOther", "relatednessSelf")], na.rm = T)

df$autonomy <- df$autonomy.daily.all
df$competence <- df$competence.daily.all
df$relatedness <- df$relatedness.daily.all

varNamIndicesS1 <- c(
  "autonomy",
  "competence",
  "relatedness",
  "education_level.pre",
  "associationMerged.pre",
  "assimilation.pre",
  "separation.pre",
  "integration.pre",
  "marginalization.pre",
  "VIA_heritage.pre",
  "VIA_Dutch.pre",
  "SSAS_surrounding.pre",
  "SSAS_privat.pre",
  "SSAS_public.pre",
  "assimilation.post",
  "separation.post",
  "integration.post",
  "marginalization.post",
  "VIA_heritage.post",
  "VIA_Dutch.post",
  "rosenberg.post",
  "social_support.post",
  "stress.post",
  "discrimination.post",
  "discrimination_month.post",
  "NLE_1month.post",
  "NLE_6month.post",
  "NLE_12month.post"
  )

df$roommate.pre_calc <- df %>%
  select(
    starts_with("roommate")
  ) %>% 
  mutate_all(as_factor) %>%
  unite(., "Comb", sep = ", ", remove = TRUE, na.rm = TRUE) %>%
  pull

df$Reason.pre_calc <- df %>%
  select(
    starts_with("Reason"),
    -Reason_nodesire, 
    -ReasonOther.pre 
  ) %>% 
  mutate_all(as_factor) %>% 
  unite(., "Comb", sep = ", ", remove = TRUE, na.rm = TRUE) %>%
  pull

df$occupation.pre_calc <- df %>%
  select(
    starts_with("occupation"),
    -occupation_8_TEXT.pre
  ) %>%
  mutate_all(as_factor) %>% 
  unite(., "Comb", sep = ", ", remove = TRUE, na.rm = TRUE) %>% 
  pull 
  
df$CurrentEducation.pre_calc <-
  df %>%
  select(starts_with("CurrentEducation"),
         -CurrentEducation_6_TEXT.pre) %>%
  mutate_all(as_factor) %>%
  unite(.,
        "Comb",
        sep = ", ",
        remove = TRUE,
        na.rm = TRUE) %>%
  pull

df$groupType.pre_calc <-
  df %>%
  select(starts_with("gr_type"),
          -ends_with("TEXT")) %>%
  mutate_all(as_factor) %>% 
  unite(.,
        "Comb",
        sep = ", ",
        remove = TRUE,
        na.rm = TRUE) %>%
  pull

df$groupContext.pre_calc <-
  df %>%
  select(starts_with("gr_context"),
          -ends_with("TEXT")) %>%
  mutate_all(as_factor) %>% 
  unite(.,
        "Comb",
        sep = ", ",
        remove = TRUE,
        na.rm = TRUE) %>%
  pull

df$dyadType.pre_calc <-
  df %>%
  select(starts_with("dyad_type"),
          -ends_with("TEXT")) %>%
  mutate_all(as_factor) %>% 
  unite(.,
        "Comb",
        sep = ", ",
        remove = TRUE,
        na.rm = TRUE) %>%
  pull

df$context.pre_calc <-
  df %>%
  select(starts_with("Context"),
          -ends_with("TEXT")) %>% 
  mutate_all(as_factor) %>% 
  unite(.,
        "Comb",
        sep = ", ",
        remove = TRUE,
        na.rm = TRUE) %>%
  pull

df$desireType.pre_calc <-
  df %>%
  select(starts_with("desire_type"),
          -ends_with("TEXT")) %>% 
  mutate_all(as_factor) %>% 
  unite(.,
        "Comb",
        sep = ", ",
        remove = TRUE,
        na.rm = TRUE) %>%
  pull

df$desireType.pre_calc <-
  df %>%
  select(starts_with("desire_context"),
          -ends_with("TEXT")) %>% 
  mutate_all(as_factor) %>% 
  unite(.,
        "Comb",
        sep = ", ",
        remove = TRUE,
        na.rm = TRUE) %>%
  pull

df$nonDutchType.pre_calc <-
  df %>%
  select(starts_with("NonDutchType"),
          -ends_with("TEXT")) %>% 
  mutate_all(as_factor) %>% 
  unite(.,
        "Comb",
        sep = ", ",
        remove = TRUE,
        na.rm = TRUE) %>%
  pull

df$autonomySat.pre_calc <-
  psych::scoreItems(
    keys = c(1, 1, 1, 1),
    items = df %>% select(matches("^SDT0[1-4].pre")),
    min = 1,
    max = 7
  )$scores %>% 
  as.numeric
df$autonomyFrust.pre_calc <-
  psych::scoreItems(
    keys = c(1, 1, 1, 1),
    items = df %>% select(matches("^SDT0[5-8].pre")),
    min = 1,
    max = 7
  )$scores %>% 
  as.numeric

df$relatednessSat.pre_calc <-
  psych::scoreItems(
    keys = c(1, 1, 1, 1),
    items = df %>% select(matches("^SDT(09|1[0-2]).pre")),
    min = 1,
    max = 7
  )$scores %>% 
  as.numeric
df$relatednessFrust.pre_calc <-
  psych::scoreItems(
    keys = c(1, 1, 1, 1),
    items = df %>% select(matches("^SDT1[3-6].pre")),
    min = 1,
    max = 7
  )$scores %>% 
  as.numeric

df$competenceSat.pre_calc <-
  psych::scoreItems(
    keys = c(1, 1, 1, 1),
    items = df %>% select(matches("^SDT(1[7-9]|20).pre")),
    min = 1,
    max = 7
  )$scores %>% 
  as.numeric
df$competenceFrust.pre_calc <-
  psych::scoreItems(
    keys = c(1, 1, 1, 1),
    items = df %>% select(matches("^SDT2[1-4].pre")),
    min = 1,
    max = 7
  )$scores %>% 
  as.numeric

df$IntGrAnx.pre_calc <-
  psych::scoreItems(
    keys = c(rep(1,6),rep(-1,6)),
    items = df %>% select(matches("^IntGrAnx[0-9]{2}.?\\.pre")),
    min = 1,
    max = 10
  )$scores %>% 
  as.numeric

df$swl.pre_calc <-
  psych::scoreItems(
    keys = rep(1,5),
    items = df %>% select(matches("^SWL[0-9]{2}\\.pre")),
    min = 1,
    max = 7,
    missing = TRUE,
    impute = "none",
  )$scores %>% 
  as.numeric

df$mdmq.alertness.pre_calc <- 
  psych::scoreItems(
    keys = c(1, -1, -1, 1),
    items = df %>% select(MDMQ02.pre, MDMQ05.pre, MDMQ07.pre, MDMQ10.pre),
    min = 1,
    max = 6,
    missing = TRUE,
    impute = "none",
  )$scores %>% 
  as.numeric
df$mdmq.calmness.pre_calc <- 
  psych::scoreItems(
    keys = c(-1, 1, -1, 1),
    items = df %>% select(MDMQ03.pre, MDMQ06.pre, MDMQ09.pre, MDMQ12.pre),
    min = 1,
    max = 6,
    missing = TRUE,
    impute = "none",
  )$scores %>% 
  as.numeric
df$mdmq.valence.pre_calc <- 
  psych::scoreItems(
    keys = c(1, -1, 1, -1),
    items = df %>% select(MDMQ01.pre, MDMQ04.pre, MDMQ08.pre, MDMQ11.pre),
    min = 1,
    max = 6,
    missing = TRUE,
    impute = "none",
  )$scores %>% 
  as.numeric

df$IntGrAnx.post_calc <-
  psych::scoreItems(
    keys = c(rep(1,6),rep(-1,6)),
    items = df %>% select(matches("^IntGrAnx[0-9]{2}.?\\.post")),
    min = 1,
    max = 10
  )$scores %>% 
  as.numeric

df$swl.post_calc <-
  psych::scoreItems(
    keys = rep(1,5),
    items = df %>% select(matches("^SWL[0-9]{2}\\.post")),
    min = 1,
    max = 7,
    missing = TRUE,
    impute = "none",
  )$scores %>% 
  as.numeric

varNamIndicesS1 <-
  append(varNamIndicesS1,
         df %>% select(ends_with("_calc")) %>% names)


#
df <- df %>%
  mutate(
    exWB = scales::rescale(exWB, from = range(exWB, na.rm = TRUE), to = c(-100, 100)),
    relatedness = relatedness + 50,
    autonomy = autonomy + 50,
    competence = competence + 50,
    KeyNeedFulfillment = KeyNeedFulfillment + 50,
    KeyNeedDueToPartner = KeyNeedDueToPartner + 50,
    InteractionContextAccidental = InteractionContextAccidental + 50,
    InteractionContextvoluntary = InteractionContextvoluntary + 50,
    InteractionContextCooperative = InteractionContextCooperative + 50,
    InteractionContextRepresentativeNL = InteractionContextRepresentativeNL + 50,
    qualityOverall = qualityOverall + 50,
    qualityMeaning = qualityMeaning + 50,
    DaytimeNeedFulfillment = DaytimeNeedFulfillment + 50
  )
dtS1$full <- df
rm(df)

Study 2

For the student sample, the data transformation stage had five main aims:

  1. We first create person, survey type, and measurement ID variables.
  2. We then created indices of scales. Some indices were multi-item scales while some indices combine equivalent measurement for different situational circumstances (e.g., competence perceptions after interactions and at measurement occasions without interactions).
  3. We add information about the interaction partner to the beep during which a person was selected as an interaction partner.
  4. We cluster mean-center key variables within participants.
  5. Finally, we calculated several basic participant summaries (averages across all measurement occasions).
df <- dtS2$clean

# Add ID variables
df$PID <- as.numeric(factor(df$ResponseId)) # participant ID

# Correct date_period ()
df <- df %>%
  mutate(
    startDate = as.Date(created),
    startTime = format(as.POSIXct(created), format = "%H:%M:%S"),
    date_period_old = date_period,
    date_period = ifelse(
      startTime >= c("12:00") & startTime <= c("18:59"),
      paste(format(as.POSIXct(created), format = "%Y-%m-%d"), "Morning"),
      ifelse(
        startTime >= c("19:00") & startTime <= c("23:59"),
        paste(format(as.POSIXct(created), format = "%Y-%m-%d"), "Afternoon"),
        ifelse(
          startTime >= c("00:00") & startTime <= c("11:59"),
          paste(as.Date(created) - 1, "Afternoon"),
          NA
        )
      )
    )
  )
  
# order time
# df$TID <- factor(df$date_period, levels = unique(dtS3$raw.daily$date_period))
# df$TIDnum <- as.numeric(df$TID) # get numeric TID
df <- df %>%
  mutate(
    dateOrder = stri_replace_all_regex(
      date_period,
      pattern = c(' Morning', ' Afternoon'),
      replacement = c('_A', '_B'),
      vectorize = FALSE
    ),
    TID = factor(date_period),
    TIDnum = as.numeric(factor(dateOrder))
  )

# check whether time ordering worked
df <- df %>%
  arrange(PID, TID) 

# Interaction as Factor
df$interaction.f <-
  factor(df$Interaction,
    levels = c("no interaction", "Dutch", "Non-Dutch")
  )
df$intNL <- ifelse(df$Interaction == "Dutch", 1, 0)
df$intNonNL <- ifelse(df$Interaction == "Non-Dutch", 1, 0)

df$IntergroupContact <- (df$IntergroupContact-2)*-1
df$IngroupContact <- (df$IngroupContact-2)*-1

# -------------------------------------------------------------------------------------------------------------
#                                       Combine Variables
# -------------------------------------------------------------------------------------------------------------
# Relatedness
pairs.panels.new(
  df[c("relatednessSelf", "relatednessOther")],
  labels = c(
    "I shared information about myself.",
    "X shared information about themselves."
  )
)

df$relatednessInteraction <- rowMeans(df[c("relatednessSelf", "relatednessOther")], na.rm = TRUE)
df$relatednessInteraction[df$relatednessInteraction == "NaN"] <- NA
# Relatedness Overall (JANNIS NOT SURE THESE ARE CORRECT, CHANGE ROWS?; JK: Changed "NaN" in df$RelatednessInteraction to NA() should work now)
df$relatedness <-
  rowMeans(df[, c("relatednessInteraction", "relatednessNoInteraction")],
           na.rm = TRUE) %>%
  ifelse(is.nan(.), NA, .)

# Core Need
df$DaytimeNeedFulfillment[df$InteractionDum == 0 & !is.na(df$KeyNeedFulfillment)] <-
  df$KeyNeedFulfillment[df$InteractionDum == 0 & !is.na(df$KeyNeedFulfillment)]

df$InteractionNeedFullfillment <- NA 
df$InteractionNeedFullfillment[df$InteractionDum == 1 & !is.na(df$KeyNeedFulfillment)] <- 
  df$KeyNeedFulfillment[df$InteractionDum == 1 & !is.na(df$KeyNeedFulfillment)]


# Randomly selected variables
df <- df %>%
  rowwise() %>%
  mutate(
    ProSo = mean(c(ProSo1, ProSo2, ProSo3, ProSo4), na.rm = TRUE),
    AntiSo = mean(c(AntiSo1, AntiSo2, AntiSo3, AntiSo4, AntiSo5, AntiSo6, AntiSo7), na.rm = TRUE)
  )

# -------------------------------------------------------------------------------------------------------------
#                                 Add Variables related to interaction partner
# -------------------------------------------------------------------------------------------------------------
# create function for later lapply
createIntPartDf <- function(inp) {
  # prepare the dataframe so that we can forloop over it later
  tmp <- data.frame(
    CC = as.character(inp$CC),
    NewCC = as.character(inp$NewCC),
    NewName = as.character(inp$NewName),
    NewCloseness = inp$NewCloseness,
    NewGender = inp$NewGender,
    NewEthnicity = as.character(inp$NewEthnicity),
    NewRelationship = as.character(inp$NewRelationship)
  )

  tmp$CC2 <- recode(tmp$CC, "SOMEONE ELSE" = "NA")
  tmp$CC2 <-
    ifelse(
      tmp$CC == 1 |
        tmp$CC == "SOMEONE ELSE",
      as.character(tmp$NewName),
      as.character(tmp$CC2)
    )
  # maybe add [[:space:]]\b to remove space before word boundary or ^[[:space:]] to remove space in the beginning of a string
  tmp$CC2 <- gsub("^[[:space:]]", "", tmp$CC2)
  tmp$NewName <- gsub("^[[:space:]]", "", tmp$NewName)

  # open the variables that will be filled up in the foor-loop
  tmp$closeness <- rep(NA, nrow(tmp))
  tmp$gender <- rep(NA, nrow(tmp))
  tmp$ethnicity <- rep(NA, nrow(tmp))
  tmp$relationship <- rep(NA, nrow(tmp))

  # Run the for-loop. It finds the variables related to the name of the interaction partner. If there is a repeating interaction
  # partner (i.e. CC2) it takes the value (i.e. NewCloseness) from the first interaction (i.e. NewName)
  for (i in 1:nrow(tmp)) {
    if (is.na(tmp$CC2[i])) {
      next
    } else {
      tmp$closeness[i] <-
        na.omit(tmp$NewCloseness[as.character(tmp$CC2[i]) == as.character(tmp$NewName)])[1] # find closeness where CC2 matches NewName (na.omit + [1] to get the number)
      tmp$gender[i] <-
        na.omit(tmp$NewGender[as.character(tmp$CC2[i]) == as.character(tmp$NewName)])[1] # (na.omit + [1] to get the number and not the rest of the na.omit list)
      tmp$ethnicity[i] <-
        na.omit(as.character(tmp$NewEthnicity[as.character(tmp$CC2[i]) == as.character(tmp$NewName)]))[1] # PROBLEM IS THAT THERE ARE TOO MANY NA's: Difficult to deal with
      tmp$relationship[i] <-
        na.omit(as.character(tmp$NewRelationship[as.character(tmp$CC2[i]) == as.character(tmp$NewName)]))[1]
    }
  }

  out <- tmp
  out
}

# split df per participants and run function
PP <- split(df, df$PID)
PP <- lapply(PP, createIntPartDf)
rm(createIntPartDf)

# add variables back to df
remergePP <- do.call(rbind.data.frame, PP)
colnames(remergePP) <-
  paste(colnames(remergePP), "_Calc", sep = "")
df <- cbind(df, remergePP)
rm(remergePP, PP)

dtS2$full <- df
rm(df)

Study 3

For the medical professional sample, the data transformation stage had five main aims:

  1. We first create person, survey type, and measurement ID variables.
  2. We then created indices of scales. Some indices were multi-item scales while some indices combine equivalent measurement for different situational circumstances (e.g., competence perceptions after interactions and at measurement occasions without interactions).
  3. We cluster mean-center key variables within participants.
  4. Finally, we calculated several basic participant summaries (averages across all measurement occasions).
df <- dtS3$clean

# Add ID variables
df$PID <- as.numeric(factor(df$ResponseId)) # participant ID

# Correct date_period ()
df <- df %>%
  mutate(
    startDate = as.Date(created),
    startTime = format(as.POSIXct(created), format = "%H:%M:%S"),
    date_period_old = date_period,
    date_period = ifelse(
      startTime >= c("12:00") & startTime <= c("18:59"),
      paste(format(as.POSIXct(created), format = "%Y-%m-%d"), "Morning"),
      ifelse(
        startTime >= c("19:00") & startTime <= c("23:59"),
        paste(format(as.POSIXct(created), format = "%Y-%m-%d"), "Afternoon"),
        ifelse(
          startTime >= c("00:00") & startTime <= c("11:59"),
          paste(as.Date(created) - 1, "Afternoon"),
          NA
        )
      )
    )
  )
  
# order time
# df$TID <- factor(df$date_period, levels = unique(dtS3$raw.daily$date_period))
# df$TIDnum <- as.numeric(df$TID) # get numeric TID
df <- df %>%
  mutate(
    dateOrder = stri_replace_all_regex(
      date_period,
      pattern = c(' Morning', ' Afternoon'),
      replacement = c('_A', '_B'),
      vectorize = FALSE
    ),
    TID = factor(date_period),
    TIDnum = as.numeric(factor(dateOrder))
  )

# check whether time ordering worked
df <- df %>%
  arrange(PID, TID)

# Interaction as Factor
df$interaction.f <-
  factor(df$Interaction,
    levels = c("no interaction", "Dutch", "Non-Dutch")
  )
df$intNL <- ifelse(df$Interaction == "Dutch", 1, 0)
df$intNonNL <- ifelse(df$Interaction == "Non-Dutch", 1, 0)

df <- df %>%
  mutate(
    NonDutchContact = replace_na(NonDutchNum, 0), # make second non-Dutch countable
    NonDutchContact = ifelse(NonDutchContact > 1, 1, 0) # recode (yes = 1 -> 1, no = 2 -> 0)
  ) %>%
  mutate(
    OutgroupInteraction = factor(
      InteractionDumDutch,
      levels = c(0, 1),
      labels = c("No", "Yes")
    ),
    NonOutgroupInteraction = factor(
      rowSums(select(., c(InteractionDumNonDutch, NonDutchContact)), na.rm = TRUE), # combine the two non-Dutch Q.,
      levels = c(0, 1),
      labels = c("No", "Yes")
    )
  )

df$IntergroupContact <- (df$IntergroupContact-2)*-1
df$IngroupContact <- (df$IngroupContact-2)*-1

# -------------------------------------------------------------------------------------------------------------
#                                       Combine Variables
# -------------------------------------------------------------------------------------------------------------
# Relatedness
pairs.panels.new(
  df[c("relatednessSelf", "relatednessOther")],
  labels = c(
    "I shared information about myself.",
    "X shared information about themselves."
  )
)

df$relatednessInteraction <-
  rowMeans(df[c("relatednessSelf", "relatednessOther")], na.rm = TRUE)
df$relatednessInteraction[df$relatednessInteraction == "NaN"] <- NA
# Relatedness Overall (JANNIS NOT SURE THESE ARE CORRECT, CHANGE ROWS?; J: Changed "NaN" in df$RelatednessInteraction to NA() should work now)
df$relatedness <-
  rowMeans(df[, c("relatednessInteraction", "relatednessNoInteraction")],
           na.rm = TRUE) %>%
  ifelse(is.nan(.), NA, .)


df$DaytimeNeedFulfillment[df$InteractionDum == 0 & !is.na(df$KeyNeedFulfillment)] <-
  df$KeyNeedFulfillment[df$InteractionDum == 0 & !is.na(df$KeyNeedFulfillment)]

df$InteractionNeedFullfillment <- NA 
df$InteractionNeedFullfillment[df$InteractionDum == 1 & !is.na(df$KeyNeedFulfillment)] <- 
  df$KeyNeedFulfillment[df$InteractionDum == 1 & !is.na(df$KeyNeedFulfillment)]

df$InteractionNeedImportance <- NA 
df$InteractionNeedImportance[df$InteractionDum == 1 & !is.na(df$KeyNeedImp)] <- 
  df$KeyNeedImp[df$InteractionDum == 1 & !is.na(df$KeyNeedImp)]


# Randomly selected variables
df <- df %>%
  rowwise() %>%
  mutate(
    ProSo = mean(c(ProSo1, ProSo2, ProSo3, ProSo4), na.rm = TRUE),
    AntiSo = mean(c(AntiSo1, AntiSo2, AntiSo3, AntiSo4, AntiSo5, AntiSo6, AntiSo7), na.rm = TRUE),
    agency = mean(c(agency1, agency2, agency3), na.rm = TRUE),
    autoFrust = mean(c(autoFrust1, autoFrust2, autoFrust3, autoFrust4), na.rm = TRUE),
    autoSat = mean(c(autoSat1, autoSat2, autoSat3, autoSat4), na.rm = TRUE),
    relatFrust = mean(c(relatFrust1, relatFrust2, relatFrust3, relatFrust4), na.rm = TRUE),
    relatSat = mean(c(relatSat1, relatSat2, relatSat3, relatSat4), na.rm = TRUE),
    compFrust = mean(c(compFrust1, compFrust2, compFrust3, compFrust4), na.rm = TRUE),
    compSat = mean(c(compSat1, compSat2, compSat3, compSat4), na.rm = TRUE),
    lonely = mean(c(lonely4, lonely4, lonely4, lonely4), na.rm = TRUE),
    emotRegPos = mean(c(emotRegPos01, emotRegPos02), na.rm = TRUE),
    emotRegNeg = mean(c(emotRegNeg01, emotRegNeg02), na.rm = TRUE)
  )


# Allport's Conditions
df %>%
  #filter(OutgroupInteraction == "Yes") %>%
  select(
    InteractionContextEqualStatus,
    KeyNeedShared,
    InteractionContextCooperative,
    InteractionContextvoluntary
  ) %>%
  pairs.panels.new

AlportDescr <- df %>%
  #filter(OutgroupInteraction == "Yes") %>%
  select(
    InteractionContextEqualStatus,
    KeyNeedShared,
    InteractionContextCooperative,
    InteractionContextvoluntary
  ) %>%
  psych::describe(., skew=F,ranges=T) %>%
  as.data.frame() %>%
  select(-vars) %>%
  kable(., caption = "Descriptives of Allport's Condition items") %>% 
  kable_styling("hover", full_width = F, latex_options = "hold_position")



iaWorkerAllport <- 
  df %>%
  #filter(OutgroupInteraction == "Yes") %>%
  select(
    InteractionContextEqualStatus,
    KeyNeedShared,
    InteractionContextCooperative,
    InteractionContextvoluntary
  )

itemScaleAllport01 <- sjPlot::tab_itemscale(iaWorkerAllport)

pca <- parameters::principal_components(iaWorkerAllport)
factor.groups <- parameters::closest_component(pca)

sjPlot::tab_itemscale(iaWorkerAllport, factor.groups, show.kurtosis = TRUE)
Component 1
Row Missings Mean SD Skew Kurtosis Item Difficulty Item Discrimination α if deleted
InteractionContextEqualStatus 24.54 % 81.84 23.58 -1.43 1.66 0.82 0.48 0.64
InteractionContextCooperative 24.54 % 85.67 18.35 -1.55 3.22 0.86 0.57 0.53
InteractionContextvoluntary 24.54 % 84.14 22.28 -1.7 2.98 0.84 0.48 0.62
Mean inter-item-correlation=0.436 · Cronbach’s α=0.688

 

Component 2
Row Missings Mean SD Skew Kurtosis Item Difficulty Item Discrimination α if deleted
KeyNeedShared 24.28 % 84.9 18.74 -1.78 4.40 0.85 NA NA
Mean inter-item-correlation=NaN · Cronbach’s α=0.688

 

  Component 1 Component 2
Component 1 α=0.688  
Component 2 0.421
(<.001)
NA
Computed correlation used pearson-method with listwise-deletion.
AllportAlpha <- ltm::cronbach.alpha(na.omit(iaWorkerAllport), CI = TRUE)


data <- 
  df %>%
  select(
    PID,
    TIDnum,
    InteractionContextEqualStatus,
    KeyNeedShared,
    InteractionContextCooperative,
    InteractionContextvoluntary
  ) %>%
  drop_na %>%
  reshape2::melt(
    ., 
    id.vars = c("PID", "TIDnum")
  )

AllportNestedAlpha <- horst::nestedAlpha(item.level.1 = "value",
                   level.2      = "TIDnum",
                   level.3      = "PID",
                   data         = data)
rm(data)

iaWorkerAllportScale <- 
  iaWorkerAllport %>%
  Scale::Scale() %>%
  Scale::ItemAnalysis()

df$AllportsCondition <-
  scoreItems(
    keys = c(1, 1, 1, 1),
    items = df %>% select(
      InteractionContextEqualStatus,
      KeyNeedShared,
      InteractionContextCooperative,
      InteractionContextvoluntary
    ),
    min = 0,
    max = 100
  )$scores

as.data.frame(psych::describe(df$AllportsCondition, skew=T)) %>%
  mutate(vars = "Allport's Conditions Index") %>%
  kable(., caption = "Allport's Conditions: Scale Descriptives", row.names = FALSE) %>% 
  kable_styling("hover", full_width = F, latex_options = "hold_position")
Table 1: Allport’s Conditions: Scale Descriptives
vars n mean sd median trimmed mad min max range skew kurtosis se
Allport’s Conditions Index 4107 86.49 13.88 93.75 88.6 9.266 0 100 100 -1.454 2.406 0.2165
ggplot(df, aes(x = AllportsCondition)) +
  geom_histogram() +
  theme_Publication()

# -------------------------------------------------------------------------------------------------------------
#                                 Add Variables related to interaction partner
# -------------------------------------------------------------------------------------------------------------
# create function for later lapply
createIntPartDf <- function(inp) {
  # prepare the dataframe so that we can forloop over it later
  tmp <- data.frame(
    CC = as.character(inp$CC),
    NewCC = as.character(inp$NewCC),
    NewName = as.character(inp$NewName),
    NewCloseness = inp$NewCloseness,
    NewGender = inp$NewGender,
    NewEthnicity = as.character(inp$NewEthnicity),
    NewRelationship = as.character(inp$NewRelationship)
  )

  tmp$CC2 <- recode(tmp$CC, "SOMEONE ELSE" = "NA")
  tmp$CC2 <-
    ifelse(
      tmp$CC == 1 |
        tmp$CC == "SOMEONE ELSE",
      as.character(tmp$NewName),
      as.character(tmp$CC2)
    )
  # maybe add [[:space:]]\b to remove space before word boundary or ^[[:space:]] to remove space in the beginning of a string
  tmp$CC2 <- gsub("^[[:space:]]", "", tmp$CC2)
  tmp$NewName <- gsub("^[[:space:]]", "", tmp$NewName)

  # open the variables that will be filled up in the foor-loop
  tmp$closeness <- rep(NA, nrow(tmp))
  tmp$gender <- rep(NA, nrow(tmp))
  tmp$ethnicity <- rep(NA, nrow(tmp))
  tmp$relationship <- rep(NA, nrow(tmp))

  # Run the for-loop. It finds the variables related to the name of the interaction partner. If there is a repeating interaction
  # partner (i.e. CC2) it takes the value (i.e. NewCloseness) from the first interaction (i.e. NewName)
  for (i in 1:nrow(tmp)) {
    if (is.na(tmp$CC2[i])) {
      next
    } else {
      tmp$closeness[i] <-
        na.omit(tmp$NewCloseness[as.character(tmp$CC2[i]) == as.character(tmp$NewName)])[1] # find closeness where CC2 matches NewName (na.omit + [1] to get the number)
      tmp$gender[i] <-
        na.omit(tmp$NewGender[as.character(tmp$CC2[i]) == as.character(tmp$NewName)])[1] # (na.omit + [1] to get the number and not the rest of the na.omit list)
      tmp$ethnicity[i] <-
        na.omit(as.character(tmp$NewEthnicity[as.character(tmp$CC2[i]) == as.character(tmp$NewName)]))[1] # PROBLEM IS THAT THERE ARE TOO MANY NA's: Difficult to deal with
      tmp$relationship[i] <-
        na.omit(as.character(tmp$NewRelationship[as.character(tmp$CC2[i]) == as.character(tmp$NewName)]))[1]
    }
  }

  out <- tmp
  out
}

# split df per participants and run function
PP <- split(df, df$PID)
PP <- lapply(PP, createIntPartDf)
rm(createIntPartDf)

# add variables back to df
remergePP <- do.call(rbind.data.frame, PP)
colnames(remergePP) <-
  paste(colnames(remergePP), "_Calc", sep = "")
df <- cbind(df, remergePP)
rm(remergePP, PP)

dtS3$full <- df

Data Availability and Sample Selection

As one of our main analyses is a three-mode principal component analysis (3MPCA) we begin by assessing the amount of missing data in each of the ESM studies. To assess the missingness in detail, we prepare a data availability table of whether data is available or missing for each possible measurement point (data + morning/afternoon) for all individual participants. We then export the data availability tables as comma separated value files (.csv) to be assessed in detail using a spreadsheet program (such as MS Excel).

For our sample selection we address both the selection of time points and participants. Given that multiple imputation procedures even work well with large proportions of missing data [assuming missingness at random; Madley-Dowd et al. (2019)], we decided on a general criterion of less than 45% missingness to balance sample size retention and bias in the multiple imputation model. Thus, we then select the time points for which we have less than 45% missingness and select participants who have less than 45% missingness across the selected time range.

To approximate an ideal sample selection that maximized the number of participants and timepoints that fit the 55% data availability criterion. We select sequentially remove the rows or columns with the lowest data availability rate untill all rows and columns have more than 55% data available (i.e., less than 45% missingness).

Study 1

dtS1Availability <- dtS1$full %>%
  select(
    PID,
    TIDnum
  ) %>%
  arrange(PID, TIDnum) %>%
  mutate(data = 1)
dtS1Availability <- reshape::cast(dtS1Availability, PID ~ TIDnum) %>%
  select(-PID) %>%
  mutate_all(function(x) ifelse(x>1,1,x))
# sum(colMeans(dtS1Availability)*100 >= 66)
# sum(rowMeans(dtS1Availability)*100 >= 66)
# sum(colMeans(dtS1Availability[-5,])*100 >= 66)
# sum(rowMeans(dtS1Availability[,-8])*100 >= 66)

rownames(dtS1Availability) <- paste("PP", 1:nrow(dtS1Availability), sep = "_")
colnames(dtS1Availability) <- paste("t", 1:ncol(dtS1Availability), sep = "_")
dtS1AvailabilityKbl <- dtS1Availability

dtS1AvailabilityKbl[1:ncol(dtS1AvailabilityKbl)] <- lapply(dtS1AvailabilityKbl[1:ncol(dtS1AvailabilityKbl)], function(x) {
    cell_spec(x,
              bold = FALSE,
              color = "white",
              background = ifelse(x == 1, "green", "red")
              )
})
kbl(
  dtS1AvailabilityKbl,
  format = "html",
  escape = FALSE,
  align = "c",
  booktabs = TRUE,
  caption = "Study 1: Data Availability" # complete caption for main document
) %>%
  kable_classic(
    full_width = FALSE,
    lightable_options = "hover",
    html_font = "Cambria"
  ) %>%
  scroll_box(width = "100%", height = "500px")
Table 2: Study 1: Data Availability
t_1 t_2 t_3 t_4 t_5 t_6 t_7 t_8 t_9 t_10 t_11 t_12 t_13 t_14 t_15 t_16 t_17 t_18 t_19 t_20 t_21 t_22 t_23 t_24 t_25 t_26 t_27 t_28 t_29 t_30 t_31 t_32 t_33 t_34 t_35 t_36 t_37 t_38 t_39 t_40 t_41 t_42 t_43 t_44 t_45 t_46 t_47 t_48 t_49 t_50 t_51 t_52 t_53 t_54 t_55 t_56 t_57 t_58 t_59 t_60 t_61 t_62 t_63
PP_1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1
PP_2 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
PP_3 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0
P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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
PP_20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
PP_21 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
PP_22 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
PP_23 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1
write.csv(dtS1Availability, "data/S1_Workers/processed/workerAvailability.csv")
cleanM <- function(M, c = 55) { #c = 66
  check <- list()
  rowNamesOut <- c()
  colNamesOut <- c()
  for (i in 1:length(c(row.names(M), names(M)))) {
    rowMeans <- rowMeans(M) * 100
    colMeans <- colMeans(M) * 100
    rcMeans <- c(rowMeans, colMeans)
    rm <- which.min(rcMeans) %>% names
    rc <- ifelse(startsWith(rm, "PP_"), "row", "col")
    
    check[[i]] <- rcMeans
    
    if (!all(rcMeans >= c) && rc == "row") {
      M <- M[!(row.names(M) %in% rm), ]
      rowNamesOut <- append(rowNamesOut, rm)
      cat(i, ": Row ", rm, " had a completion rate of ", format(round(min(rcMeans), 2), nsmall = 2), "% and was removed.\n", sep = "")
    } else if (!all(rcMeans >= c) && rc == "col") {
      M <- M[, !(names(M) %in% rm)]
      colNamesOut <- append(colNamesOut, rm)
      cat(i, ": Column ", rm, " had a completion rate of ", format(round(min(rcMeans), 2), nsmall = 2), "% and was removed.\n", sep = "")
    } else {
      cat(i, ": All row- and column means are over ", c, "%. The final matrix has ", nrow(M), " rows and ", ncol(M), " columns.", sep = "")
      return(
        list(
          reducedMatrix = M,
          rowNamesIn = row.names(M),
          colNamesIn = names(M),
          rowNamesOut = rowNamesOut,
          colNamesOut = colNamesOut,
          rowMeans = rowMeans,
          colMeans = colMeans
        )
      )
    }
  }
}

dtS1RedInfo <- cleanM(M = as.data.frame(dtS1Availability), c = 55)
## 1: Row PP_20 had a completion rate of 3.17% and was removed.
## 2: Row PP_22 had a completion rate of 4.76% and was removed.
## 3: Column t_1 had a completion rate of 23.81% and was removed.
## 4: Column t_2 had a completion rate of 52.38% and was removed.
## 5: All row- and column means are over 55%. The final matrix has 21 rows and 61 columns.
PIDout <- gsub("PP_", "", dtS1RedInfo$rowNamesOut) %>% as.numeric
TIDout <- gsub("t_", "", dtS1RedInfo$colNamesOut) %>% as.numeric
TIDInRed <- gsub("t_", "", dtS1RedInfo$colNamesIn) %>% as.numeric
TIDIn <- seq(min(TIDInRed), max(TIDInRed), 1)

dtS1Red <- dtS1$full %>%
  filter(
    !PID %in% PIDout,
    TIDnum %in% TIDIn
  ) %>% 
  mutate(TIDnum = TIDnum - min(TIDnum))
rm(PIDout, TIDout, TIDInRed, TIDIn)

# change glitch where survey was sent too early
dtS1Red$TIDnum[dtS1Red$PID == 7 & as.character(dtS1Red$created) == "2018-05-18 11:46:40"] <- 10
dtS1Red$TID[dtS1Red$PID == 7 & as.character(dtS1Red$created) == "2018-05-18 11:46:40"] <- "2018-05-18 Morning"

dtS1AvailabilityRedKbl <- dtS1RedInfo$reducedMatrix
dtS1AvailabilityRedKbl[1:ncol(dtS1AvailabilityRedKbl)] <- lapply(dtS1AvailabilityRedKbl[1:ncol(dtS1AvailabilityRedKbl)], function(x) {
    cell_spec(x,
              bold = FALSE,
              color = "white",
              background = ifelse(x == 1, "green", "red")
              )
})
kbl(
  dtS1AvailabilityRedKbl,
  format = "html",
  escape = FALSE,
  align = "c",
  booktabs = TRUE,
  caption = "Study 1: Final Data Availability" # complete caption for main document
) %>%
  kable_classic(
    full_width = FALSE,
    lightable_options = "hover",
    html_font = "Cambria"
  ) %>%
  scroll_box(width = "100%", height = "500px")
Table 3: Study 1: Final Data Availability
t_3 t_4 t_5 t_6 t_7 t_8 t_9 t_10 t_11 t_12 t_13 t_14 t_15 t_16 t_17 t_18 t_19 t_20 t_21 t_22 t_23 t_24 t_25 t_26 t_27 t_28 t_29 t_30 t_31 t_32 t_33 t_34 t_35 t_36 t_37 t_38 t_39 t_40 t_41 t_42 t_43 t_44 t_45 t_46 t_47 t_48 t_49 t_50 t_51 t_52 t_53 t_54 t_55 t_56 t_57 t_58 t_59 t_60 t_61 t_62 t_63
PP_1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1
PP_2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
PP_3 0 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0
PP_4 0 0 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 1 1 1 0 0 0 1 1 0 0 0 0 0 0 0
PP_5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1 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1 1 1 1 1 0 1 1 1 1 1

Study 2

dtS2Availability <- dtS2$full %>%
  select(
    PID,
    TIDnum
  ) %>%
  #na.omit %>%
  arrange(PID, TIDnum) %>%
  mutate(data = 1)
dtS2Availability <- reshape::cast(dtS2Availability, PID ~ TIDnum) %>%
  select(-PID)

rownames(dtS2Availability) <- paste("PP", 1:nrow(dtS2Availability), sep = "_")
colnames(dtS2Availability) <- paste("t", 1:ncol(dtS2Availability), sep = "_")

write.csv(dtS2Availability, "data/S2_Students/processed/studentAvailability.csv")

dtS2AvailabilityKbl <- dtS2Availability
dtS2AvailabilityKbl[1:ncol(dtS2AvailabilityKbl)] <- lapply(dtS2AvailabilityKbl[1:ncol(dtS2AvailabilityKbl)], function(x) {
    cell_spec(x,
              bold = FALSE,
              color = "white",
              background = ifelse(x == 1, "green", "red")
              )
})
kbl(
  dtS2AvailabilityKbl,
  format = "html",
  escape = FALSE,
  align = "c",
  booktabs = TRUE,
  caption = "Study 2: Data Availability" # complete caption for main document
) %>%
  kable_classic(
    full_width = FALSE,
    lightable_options = "hover",
    html_font = "Cambria"
  ) %>%
  scroll_box(width = "100%", height = "500px")
Table 4: Study 2: Data Availability
t_1 t_2 t_3 t_4 t_5 t_6 t_7 t_8 t_9 t_10 t_11 t_12 t_13 t_14 t_15 t_16 t_17 t_18 t_19 t_20 t_21 t_22 t_23 t_24 t_25 t_26 t_27 t_28 t_29 t_30 t_31 t_32 t_33 t_34 t_35 t_36 t_37 t_38 t_39 t_40 t_41 t_42 t_43 t_44 t_45 t_46 t_47 t_48 t_49 t_50 t_51 t_52 t_53 t_54 t_55 t_56 t_57 t_58 t_59 t_60 t_61 t_62 t_63 t_64 t_65 t_66 t_67 t_68 t_69
PP_1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 0 0 0
P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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 0 1 1 0 0
PP_110 0 0 0 0 0 0 1 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
PP_111 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
PP_112 0 0 1 1 1 1 1 1 1 1 0 1 1 1 1 0 1 0 1 0 1 1 1 0 1 0 0 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0
PP_113 0 0 0 0 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 0 1 0 0 1 1 1 1 1 0 0 0 1 1 1 0 0 1 0 0 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 0 0 0 1 1 1 0 1 0 0 0
dtS2RedInfo <- cleanM(M = as.data.frame(dtS2Availability), c = 55)
## 1: Column t_69 had a completion rate of 0.88% and was removed.
## 2: Column t_67 had a completion rate of 7.08% and was removed.
## 3: Column t_68 had a completion rate of 7.08% and was removed.
## 4: Row PP_107 had a completion rate of 7.58% and was removed.
## 5: Row PP_26 had a completion rate of 9.09% and was removed.
## 6: Row PP_100 had a completion rate of 9.09% and was removed.
## 7: Row PP_110 had a completion rate of 9.09% and was removed.
## 8: Row PP_111 had a completion rate of 10.61% and was removed.
## 9: Column t_2 had a completion rate of 15.74% and was removed.
## 10: Column t_1 had a completion rate of 18.52% and was removed.
## 11: Column t_65 had a completion rate of 18.52% and was removed.
## 12: Row PP_31 had a completion rate of 20.63% and was removed.
## 13: Column t_66 had a completion rate of 23.36% and was removed.
## 14: Row PP_87 had a completion rate of 25.81% and was removed.
## 15: Row PP_40 had a completion rate of 27.42% and was removed.
## 16: Row PP_70 had a completion rate of 29.03% and was removed.
## 17: Row PP_81 had a completion rate of 29.03% and was removed.
## 18: Row PP_12 had a completion rate of 30.65% and was removed.
## 19: Row PP_66 had a completion rate of 30.65% and was removed.
## 20: Row PP_103 had a completion rate of 32.26% and was removed.
## 21: Row PP_85 had a completion rate of 37.10% and was removed.
## 22: Row PP_71 had a completion rate of 38.71% and was removed.
## 23: Row PP_11 had a completion rate of 40.32% and was removed.
## 24: Row PP_15 had a completion rate of 41.94% and was removed.
## 25: Row PP_43 had a completion rate of 41.94% and was removed.
## 26: Column t_64 had a completion rate of 43.16% and was removed.
## 27: Row PP_6 had a completion rate of 45.90% and was removed.
## 28: Row PP_7 had a completion rate of 45.90% and was removed.
## 29: Row PP_18 had a completion rate of 45.90% and was removed.
## 30: Row PP_13 had a completion rate of 47.54% and was removed.
## 31: Column t_63 had a completion rate of 48.35% and was removed.
## 32: Row PP_29 had a completion rate of 50.00% and was removed.
## 33: Column t_4 had a completion rate of 51.11% and was removed.
## 34: Row PP_101 had a completion rate of 50.85% and was removed.
## 35: Row PP_28 had a completion rate of 52.54% and was removed.
## 36: Row PP_77 had a completion rate of 52.54% and was removed.
## 37: Row PP_49 had a completion rate of 54.24% and was removed.
## 38: All row- and column means are over 55%. The final matrix has 86 rows and 59 columns.
PIDout <- gsub("PP_", "", dtS2RedInfo$rowNamesOut) %>% as.numeric
TIDout <- gsub("t_", "", dtS2RedInfo$colNamesOut) %>% as.numeric
TIDInRed <- gsub("t_", "", dtS2RedInfo$colNamesIn) %>% as.numeric
TIDIn <- seq(min(TIDInRed), max(TIDInRed), 1)

dtS2Red <- dtS2$full %>%
  filter(
    !PID %in% PIDout,
    TIDnum %in% TIDIn
  ) %>% 
  mutate(TIDnum = TIDnum - min(TIDnum))
rm(PIDout, TIDout, TIDInRed, TIDIn)

# remove glitch entries 
dtS2Red <- dtS2Red[!(dtS2Red$PID == 46 & dtS2Red$TIDnum == 57 & dtS2Red$ended == "2018-12-20 21:58:31"),]
dtS2Red <- dtS2Red[!(dtS2Red$PID == 46 & dtS2Red$TIDnum == 59 & dtS2Red$ended == "2018-12-20 21:58:31"),]

dtS2AvailabilityRedKbl <- dtS2RedInfo$reducedMatrix
dtS2AvailabilityRedKbl[1:ncol(dtS2AvailabilityRedKbl)] <- lapply(dtS2AvailabilityRedKbl[1:ncol(dtS2AvailabilityRedKbl)], function(x) {
    cell_spec(x,
              bold = FALSE,
              color = "white",
              background = ifelse(x == 1, "green", "red")
              )
})
kbl(
  dtS2AvailabilityRedKbl,
  format = "html",
  escape = FALSE,
  align = "c",
  booktabs = TRUE,
  caption = "Study 2: Final Data Availability" # complete caption for main document
) %>%
  kable_classic(
    full_width = FALSE,
    lightable_options = "hover",
    html_font = "Cambria"
  ) %>%
  scroll_box(width = "100%", height = "500px")
Table 5: Study 2: Final Data Availability
t_3 t_5 t_6 t_7 t_8 t_9 t_10 t_11 t_12 t_13 t_14 t_15 t_16 t_17 t_18 t_19 t_20 t_21 t_22 t_23 t_24 t_25 t_26 t_27 t_28 t_29 t_30 t_31 t_32 t_33 t_34 t_35 t_36 t_37 t_38 t_39 t_40 t_41 t_42 t_43 t_44 t_45 t_46 t_47 t_48 t_49 t_50 t_51 t_52 t_53 t_54 t_55 t_56 t_57 t_58 t_59 t_60 t_61 t_62
PP_1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1
PP_2 1 1 1 0 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 0 0 1 1 1 0 1 1 0 0 0 0 0
PP_3 1 1 0 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 0 1 1 1 1 1 0 0 0 1 1 1 0 0 1 0 0 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 1 0 1 1 0 0 0 1

Study 3

dtS3Availability <- dtS3$full %>%
  select(
    PID,
    TIDnum
  ) %>%
  arrange(PID, TIDnum) %>%
  mutate(data = 1)
dtS3Availability <- reshape::cast(dtS3Availability, PID ~ TIDnum, fill = 0) %>%
  select(-PID)

rownames(dtS3Availability) <- paste("PP", 1:nrow(dtS3Availability), sep = "_")
colnames(dtS3Availability) <- paste("t", 1:ncol(dtS3Availability), sep = "_")

write.csv(dtS3Availability, "data/S3_Medical/processed/medicalAvailability.csv")

dtS3AvailabilityKbl <- dtS3Availability
dtS3AvailabilityKbl[1:ncol(dtS3AvailabilityKbl)] <- lapply(dtS3AvailabilityKbl[1:ncol(dtS3AvailabilityKbl)], function(x) {
    cell_spec(x,
              bold = FALSE,
              color = "white",
              background = ifelse(x == 1, "green", "red")
              )
})
kbl(
  dtS3AvailabilityKbl,
  format = "html",
  escape = FALSE,
  align = "c",
  booktabs = TRUE,
  caption = "Study 2: Data Availability" # complete caption for main document
) %>%
  kable_classic(
    full_width = FALSE,
    lightable_options = "hover",
    html_font = "Cambria"
  ) %>%
  scroll_box(width = "100%", height = "500px")
Table 6: Study 2: Data Availability
t_1 t_2 t_3 t_4 t_5 t_6 t_7 t_8 t_9 t_10 t_11 t_12 t_13 t_14 t_15 t_16 t_17 t_18 t_19 t_20 t_21 t_22 t_23 t_24 t_25 t_26 t_27 t_28 t_29 t_30 t_31 t_32 t_33 t_34 t_35 t_36 t_37 t_38 t_39 t_40 t_41 t_42 t_43 t_44 t_45 t_46 t_47 t_48 t_49 t_50 t_51 t_52 t_53 t_54 t_55 t_56 t_57 t_58 t_59 t_60 t_61 t_62 t_63 t_64 t_65 t_66 t_67 t_68 t_69 t_70 t_71 t_72 t_73 t_74 t_75 t_76 t_77 t_78 t_79 t_80 t_81 t_82 t_83 t_84 t_85 t_86 t_87 t_88 t_89 t_90 t_91 t_92 t_93 t_94 t_95 t_96 t_97 t_98 t_99 t_100 t_101 t_102 t_103 t_104 t_105 t_106 t_107 t_108 t_109 t_110 t_111 t_112 t_113 t_114 t_115 t_116 t_117 t_118 t_119 t_120 t_121 t_122 t_123 t_124 t_125 t_126 t_127 t_128 t_129 t_130 t_131 t_132 t_133 t_134 t_135 t_136 t_137 t_138 t_139 t_140 t_141 t_142 t_143 t_144 t_145 t_146 t_147 t_148 t_149 t_150 t_151 t_152 t_153 t_154 t_155
PP_1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 1 0 0 1 0 1 1 0 0 1 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
PP_2 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 0 0 0 0 0 1 0 0 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
PP_3 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
rm(dtS3AvailabilityKbl)
dtS3RedInfo <- cleanM(M = as.data.frame(dtS3Availability), c = 55)
## 1: Column t_1 had a completion rate of 1.41% and was removed.
## 2: Column t_2 had a completion rate of 1.41% and was removed.
## 3: Column t_3 had a completion rate of 1.41% and was removed.
## 4: Column t_4 had a completion rate of 1.41% and was removed.
## 5: Column t_5 had a completion rate of 1.41% and was removed.
## 6: Column t_6 had a completion rate of 1.41% and was removed.
## 7: Column t_136 had a completion rate of 1.41% and was removed.
## 8: Column t_138 had a completion rate of 1.41% and was removed.
## 9: Column t_147 had a completion rate of 1.41% and was removed.
## 10: Column t_148 had a completion rate of 1.41% and was removed.
## 11: Column t_149 had a completion rate of 1.41% and was removed.
## 12: Column t_150 had a completion rate of 1.41% and was removed.
## 13: Column t_152 had a completion rate of 1.41% and was removed.
## 14: Column t_153 had a completion rate of 1.41% and was removed.
## 15: Column t_154 had a completion rate of 1.41% and was removed.
## 16: Column t_155 had a completion rate of 1.41% and was removed.
## 17: Column t_137 had a completion rate of 2.82% and was removed.
## 18: Column t_139 had a completion rate of 2.82% and was removed.
## 19: Column t_140 had a completion rate of 2.82% and was removed.
## 20: Column t_141 had a completion rate of 2.82% and was removed.
## 21: Column t_142 had a completion rate of 2.82% and was removed.
## 22: Column t_143 had a completion rate of 2.82% and was removed.
## 23: Column t_144 had a completion rate of 2.82% and was removed.
## 24: Column t_151 had a completion rate of 2.82% and was removed.
## 25: Column t_135 had a completion rate of 4.23% and was removed.
## 26: Column t_145 had a completion rate of 4.23% and was removed.
## 27: Column t_146 had a completion rate of 4.23% and was removed.
## 28: Column t_106 had a completion rate of 8.45% and was removed.
## 29: Column t_122 had a completion rate of 8.45% and was removed.
## 30: Column t_133 had a completion rate of 8.45% and was removed.
## 31: Column t_110 had a completion rate of 9.86% and was removed.
## 32: Column t_111 had a completion rate of 9.86% and was removed.
## 33: Column t_134 had a completion rate of 9.86% and was removed.
## 34: Row PP_1 had a completion rate of 10.66% and was removed.
## 35: Column t_104 had a completion rate of 11.43% and was removed.
## 36: Column t_107 had a completion rate of 11.43% and was removed.
## 37: Column t_120 had a completion rate of 11.43% and was removed.
## 38: Column t_124 had a completion rate of 11.43% and was removed.
## 39: Column t_128 had a completion rate of 11.43% and was removed.
## 40: Column t_121 had a completion rate of 12.86% and was removed.
## 41: Column t_125 had a completion rate of 12.86% and was removed.
## 42: Column t_126 had a completion rate of 12.86% and was removed.
## 43: Column t_127 had a completion rate of 12.86% and was removed.
## 44: Column t_132 had a completion rate of 12.86% and was removed.
## 45: Column t_92 had a completion rate of 14.29% and was removed.
## 46: Column t_100 had a completion rate of 14.29% and was removed.
## 47: Column t_102 had a completion rate of 14.29% and was removed.
## 48: Column t_105 had a completion rate of 14.29% and was removed.
## 49: Column t_116 had a completion rate of 14.29% and was removed.
## 50: Column t_123 had a completion rate of 14.29% and was removed.
## 51: Column t_88 had a completion rate of 15.71% and was removed.
## 52: Column t_97 had a completion rate of 15.71% and was removed.
## 53: Column t_101 had a completion rate of 15.71% and was removed.
## 54: Column t_113 had a completion rate of 15.71% and was removed.
## 55: Column t_117 had a completion rate of 15.71% and was removed.
## 56: Column t_129 had a completion rate of 15.71% and was removed.
## 57: Column t_131 had a completion rate of 15.71% and was removed.
## 58: Column t_98 had a completion rate of 17.14% and was removed.
## 59: Column t_99 had a completion rate of 17.14% and was removed.
## 60: Column t_112 had a completion rate of 17.14% and was removed.
## 61: Column t_114 had a completion rate of 17.14% and was removed.
## 62: Column t_119 had a completion rate of 17.14% and was removed.
## 63: Column t_130 had a completion rate of 17.14% and was removed.
## 64: Column t_95 had a completion rate of 18.57% and was removed.
## 65: Column t_103 had a completion rate of 18.57% and was removed.
## 66: Column t_108 had a completion rate of 18.57% and was removed.
## 67: Column t_109 had a completion rate of 18.57% and was removed.
## 68: Column t_115 had a completion rate of 18.57% and was removed.
## 69: Row PP_36 had a completion rate of 19.32% and was removed.
## 70: Column t_84 had a completion rate of 20.29% and was removed.
## 71: Column t_91 had a completion rate of 20.29% and was removed.
## 72: Column t_93 had a completion rate of 20.29% and was removed.
## 73: Column t_96 had a completion rate of 20.29% and was removed.
## 74: Column t_118 had a completion rate of 20.29% and was removed.
## 75: Row PP_18 had a completion rate of 21.69% and was removed.
## 76: Row PP_45 had a completion rate of 22.89% and was removed.
## 77: Row PP_8 had a completion rate of 24.10% and was removed.
## 78: Row PP_68 had a completion rate of 24.10% and was removed.
## 79: Column t_90 had a completion rate of 26.15% and was removed.
## 80: Row PP_5 had a completion rate of 26.83% and was removed.
## 81: Column t_86 had a completion rate of 26.56% and was removed.
## 82: Row PP_6 had a completion rate of 27.16% and was removed.
## 83: Column t_94 had a completion rate of 26.98% and was removed.
## 84: Column t_87 had a completion rate of 28.57% and was removed.
## 85: Row PP_35 had a completion rate of 27.85% and was removed.
## 86: Column t_89 had a completion rate of 29.03% and was removed.
## 87: Row PP_46 had a completion rate of 28.21% and was removed.
## 88: Row PP_38 had a completion rate of 29.49% and was removed.
## 89: Column t_85 had a completion rate of 30.00% and was removed.
## 90: Row PP_53 had a completion rate of 33.77% and was removed.
## 91: Column t_80 had a completion rate of 35.59% and was removed.
## 92: Column t_82 had a completion rate of 37.29% and was removed.
## 93: Row PP_54 had a completion rate of 38.67% and was removed.
## 94: Column t_74 had a completion rate of 39.66% and was removed.
## 95: Column t_83 had a completion rate of 39.66% and was removed.
## 96: Row PP_13 had a completion rate of 41.10% and was removed.
## 97: Row PP_41 had a completion rate of 41.10% and was removed.
## 98: Column t_72 had a completion rate of 42.86% and was removed.
## 99: Row PP_39 had a completion rate of 44.44% and was removed.
## 100: Column t_79 had a completion rate of 45.45% and was removed.
## 101: Column t_70 had a completion rate of 47.27% and was removed.
## 102: Column t_81 had a completion rate of 47.27% and was removed.
## 103: Row PP_31 had a completion rate of 47.83% and was removed.
## 104: Row PP_47 had a completion rate of 47.83% and was removed.
## 105: Column t_75 had a completion rate of 49.06% and was removed.
## 106: Row PP_69 had a completion rate of 48.53% and was removed.
## 107: Column t_77 had a completion rate of 50.00% and was removed.
## 108: Row PP_12 had a completion rate of 50.75% and was removed.
## 109: Row PP_63 had a completion rate of 52.24% and was removed.
## 110: Column t_69 had a completion rate of 52.00% and was removed.
## 111: Column t_76 had a completion rate of 52.00% and was removed.
## 112: Column t_78 had a completion rate of 52.00% and was removed.
## 113: Column t_8 had a completion rate of 54.00% and was removed.
## 114: All row- and column means are over 55%. The final matrix has 50 rows and 63 columns.
PIDout <- gsub("PP_", "", dtS3RedInfo$rowNamesOut) %>% as.numeric
TIDout <- gsub("t_", "", dtS3RedInfo$colNamesOut) %>% as.numeric
TIDInRed <- gsub("t_", "", dtS3RedInfo$colNamesIn) %>% as.numeric
TIDIn <- seq(min(TIDInRed), max(TIDInRed), 1)

dtS3Red <- dtS3$full %>%
  filter(
    !PID %in% PIDout,
    TIDnum %in% TIDIn
  ) %>% 
  mutate(TIDnum = TIDnum - min(TIDnum))
rm(PIDout, TIDout, TIDInRed, TIDIn)

dtS3AvailabilityRedKbl <- dtS3RedInfo$reducedMatrix
dtS3AvailabilityRedKbl[1:ncol(dtS3AvailabilityRedKbl)] <- lapply(dtS3AvailabilityRedKbl[1:ncol(dtS3AvailabilityRedKbl)], function(x) {
    cell_spec(x,
              bold = FALSE,
              color = "white",
              background = ifelse(x == 1, "green", "red")
              )
})
kbl(
  dtS3AvailabilityRedKbl,
  format = "html",
  escape = FALSE,
  align = "c",
  booktabs = TRUE,
  caption = "Study 3: Final Data Availability" # complete caption for main document
) %>%
  kable_classic(
    full_width = FALSE,
    lightable_options = "hover",
    html_font = "Cambria"
  ) %>%
  scroll_box(width = "100%", height = "500px")
Table 7: Study 3: Final Data Availability
t_7 t_9 t_10 t_11 t_12 t_13 t_14 t_15 t_16 t_17 t_18 t_19 t_20 t_21 t_22 t_23 t_24 t_25 t_26 t_27 t_28 t_29 t_30 t_31 t_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1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 0
PP_66 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 0 1 1
PP_67 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0
PP_70 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 0 1 1 1 1 1 1 0 0
PP_71 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 0 1 1 0 0 1 1 1 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 0 1 1 1 1 0 1 0 0 1 1 0 1 1 0 0 0 0
# save cleaned 
save(dtS1, dtS2, dtS3, file = "data/s123Full.RData")

# save reduced
save(list = ls(pattern = "Red$"), file = "data/s123Red.RData")

Time Scales and Timepoint Aggregation

varNamesPre <- varNames %>%
  filter(
    surveyS1 == "pre",
    surveyS2 == "pre",
    str_detect(surveyS3, "^pre")
  ) %>%
  select(varNam)
varNamesPreFull <-
  data.frame(varNam = Reduce(intersect, list(
    names(dtS1$full), names(dtS3$full), names(dtS3$full)
  ))) %>%
  filter(str_detect(varNam, ".pre$"))

varNamesDaily <- varNames %>%
  filter(
    surveyS1 == "daily",
    surveyS2 == "daily",
    surveyS3 == "daily"
  ) %>%
  select(varNam)
varNamesDailyFull <-
  data.frame(varNam = Reduce(intersect, list(
    names(dtS1Red), names(dtS2Red), names(dtS3Red)
  ))) %>%
  filter(!str_detect(varNam, ".pre$|.post$"))

varNamesPost <- varNames %>%
  filter(
    surveyS1 == "post",
    surveyS2 == "post",
    surveyS3 == "post"
  ) %>%
  select(varNam)
varNamesPostFull <-
  data.frame(varNam = Reduce(intersect, list(
    names(dtS1Red), names(dtS3Red), names(dtS3Red)
  ))) %>%
  filter(str_detect(varNam, ".post$"))
# Main Analysis: 3MPCA (common variables across studies)
dropVarPcaMain <- c(
  # Meta Data
  "last_outside_referrer",
  "created",
  "ended",
  "ip_address",
  "date",
  "ResponseId",
  "server_language",
  "Meta_Browser",
  # Interaction Dummies (non-continuous)
  "IntergroupContact",
  "IngroupContact",
  "InteractionDum",
  # Interaction Counts (non-continuous)
  "ContactNum",
  "NonDutchNum",
  "groupDutch",
  # Interaction Descriptives (non-continuous)
  "duration",
  "dyadGroup",
  "groupSize",
  # Keyneed Freetexts (non-continuous)
  "KeyNeed",
  "DaytimeNeed",
  # Relatedness individual items
  "relatednessSelf",
  "relatednessOther",
  "relatednessNoInteraction"
)

varNam3mpcaMain <- varNamesDailyFull %>%
  filter(!varNam %in% dropVarPcaMain) %>%
  pull

dtMain3mpca <- rbind(
  dtS1Red %>% select(any_of(varNam3mpcaMain)) %>% mutate(study = "S1"),
  dtS3Red %>% select(any_of(varNam3mpcaMain)) %>% mutate(study = "S2"),
  dtS3Red %>% select(any_of(varNam3mpcaMain)) %>% mutate(study = "S3")
  ) %>%
  group_by(study, PID) %>%
  mutate(ID = cur_group_id()) %>%
  ungroup %>%
  mutate(
    date = as.Date(gsub(" .*", "", TID)),
    week = strftime(date, format = "%Y-W%V")
    ) %>%
  select(
    ID,
    PID,
    TID,
    date,
    week,
    TIDnum,
    study,
    everything()
  ) %>%
  arrange(ID, TIDnum)

dtMain3mpcaDaily <- dtMain3mpca %>%
  group_by(ID, date, study) %>%
  summarise_if(is.numeric, mean, na.rm = TRUE) %>%
  ungroup %>%
  group_by(study) %>%
  mutate(TIDnum = as.numeric(factor(date))) %>%
  ungroup %>%
  select(ID, date, TIDnum, everything()) %>%
  mutate_all(~ifelse(is.nan(.), NA, .))

dtMain3mpcaWeekly <- dtMain3mpca %>%
  group_by(ID, week, study) %>%
  summarise_if(is.numeric, mean, na.rm = TRUE) %>%
  ungroup %>%
  group_by(study) %>%
  mutate(TIDnum = as.numeric(factor(week))) %>%
  ungroup %>%
  select(ID, week, TIDnum, everything()) %>%
  mutate_all(~ifelse(is.nan(.), NA, .))

We aggregate the key variables over time to archive a reasonably interpretable number of time points and remove a first proportion of missing data. Given that little data is available on the meaningful time scales of the selected psychological variables, we chose to determine the appropriate time scales using variance decomposition (e.g., see Ram et al., 2014). This is to say that we create multi-level unconditional means models (without predictors) that include possible nested time scales as levels. We chose to select time scales that align with common human cycles. We thus compare the variances of bi-daily, daily, and weekly aggregations. Additional aggregations of two weeks or the full four weeks might be possible but would most likely reduce the variance too much for any meaningul further reduction during the 3MPCA. We then chose the time scales that have the most variance.

# WILL USE IMPUTED DATA AND FOR-LOOP ACROSS ALL RELEVANT DVs
# PLOT EFFECT SIZES

dtMain3mpca <- dtMain3mpca %>%
  group_by(study) %>%
  mutate(
    TIDdate = as.numeric(factor(date)),
    TIDweek = as.numeric(factor(week))
  ) %>%
  ungroup

# Not sure whether TIDs as predictors or empty model?
keyNeedMlTest01 <-
  lme4::lmer(KeyNeedFulfillment ~ 1 + TIDnum + TIDdate + TIDweek + (1 + TIDnum + TIDdate + TIDweek | ID),
    data = dtMain3mpca
  ) 

keyNeedMlTest02 <-
  lme(
    KeyNeedFulfillment ~ 1 + TIDnum + TIDdate + TIDweek,
    random = ~ 1 + TIDnum + TIDdate + TIDweek | ID,
    data = dtMain3mpca %>% filter(!is.na(KeyNeedFulfillment)),
    control = list(opt = "nlmimb")
  ) # use optim if it does not converge

# summary(keyNeedMlTest02)
# summ(keyNeedMlTest01, digits = 3, center = FALSE)
# anova(keyNeedMlTest02)

Feature-based Time-Series Clustering

Feature-based clustering has the advantage of being extremely flexible when it comes to dealing with real-world human data. Human data is commonly noisy, incomplete, and non-stationary. Many descriptive dimension-reduction, modeling, and raw time-series clustering procedures will require complete or stationary data from the researcher, and are thus currently not well-suited to deal with messy intensive-longitudinal data collected by many social science researchers.

We used the following five-step procedure to arrive at a stable, reproducible, and meaningful differentiation of participants ESM trajectories:

  1. Variable selection
  2. Feature extraction
  3. Feature reduction
  4. Clustering
  5. Visualization, interpretation, and validation

Variable Selection

We included 12 variables that were available across all three studies and captured information about the participant’s interactions, as well as cognitive-, emotional-, and motivational self in relationship with the majority group. We chose these two aspects in particular because (1) the interaction-specific information exemplified the structural missingness issue of modern ESM data and (2) the motivational, emotional, and cognitive experience offered a diverse conceptualization of migration experience (beyond behavioral measurements) that is becoming more common in the literature (Kreienkamp et al., 2022).

FILTER BY main

In our case, we begin by collecting the variables that are in the ESM measurements of all three studies, in order to build the most powerful dataset for the main analysis. We then additionally, divide the variables by their response type and by study to check for cluster differences in the validation phase:

  1. Main Analysis: Variables across all three data sets
  2. Validation: Variables by response type (interaction-specific or not)
  3. Validation: Variables by study
varNamS123Aux <- varNames %>%
  filter(
    aux != 0,
    studyS1 == "S1",
    studyS2 == "S2",
    studyS3 == "S3"
  ) %>%
  select(varNam) %>%
  pull
varNamS1Aux <- varNames %>%
  filter(
    aux != 0,
    studyS1 == "S1"
  ) %>%
  select(varNam) %>%
  pull
varNamS2Aux <- varNames %>%
  filter(
    aux != 0,
    studyS2 == "S2"
  ) %>%
  select(varNam) %>%
  pull
varNamS3Aux <- varNames %>%
  filter(
    aux != 0,
    studyS3 == "S3"
  ) %>%
  select(varNam) %>%
  pull

varNamS123PCA <- varNames %>%
  filter(
    pca != 0,
    studyS1 == "S1",
    studyS2 == "S2",
    studyS3 == "S3"
  ) %>%
  select(varNam) %>%
  pull
varNamS1PCA <- varNames %>%
  filter(
    pca != 0,
    studyS1 == "S1"
  ) %>%
  select(varNam) %>%
  pull
varNamS2PCA <- varNames %>%
  filter(
    pca != 0,
    studyS2 == "S2"
  ) %>%
  select(varNam) %>% 
  pull
varNamS3PCA <- varNames %>%
  filter(
    pca != 0,
    studyS3 == "S3"
  ) %>%
  select(varNam) %>%
  pull

varNamOut <- c(
  "ResponseId",
  "relatednessNoInteraction",
  "relatednessSelf",
  "relatednessOther",
  "autonomy_Int",
  "autonomy_NoInt",
  "competence_Int",
  "competence_NoInt",
  varNamS1PCA[grepl('^MDMQ', varNamS1PCA)],
  varNamS2PCA[grepl('^ProSo|^AntiSo', varNamS2PCA)],
  varNamS3PCA[grepl(
    '^ProSo|^AntiSo|^agency|^autoFrust|^autoSat|^relatFrust|^relatSat|^compFrust|^compSat|^lonely[0-9]|^emotRegPos|^emotRegNeg',
    varNamS3PCA
  )]
)
varNamCore <- c(
  "PID",
  "TID",
  "TIDnum"
)
varNamNewAll <- c(
  "relatedness",
  "autonomy",
  "competence"
)
varNamNewS1 <- c(
  "relatedness",
  "autonomy",
  "competence",
  "alertness", 
  "calmness", 
  "valence"
)
varNamNewS2 <- c(
  "relatedness",
  "autonomy",
  "competence",
  "ProSo", 
  "AntiSo"
)
varNamNewS3 <- c(
  "relatedness",
  "autonomy",
  "competence",
  "ProSo", 
  "AntiSo",
  "agency",
  "autoFrust",
  "autoSat",
  "relatFrust",
  "relatSat",
  "compFrust",
  "compSat",
  "lonely",
  "emotRegPos",
  "emotRegNeg"
)

varNamNewCat <- c(
  "closeness_Calc",
  "gender_Calc",
  "ethnicity_Calc",
  "relationship_Calc"
)

varNamIntDep <- c(
  varNamS123PCA[grepl('^InteractionContext|AttitudesPartner|KeyNeedDueToPartner|^quality', varNamS123PCA)]
)

varNamIndiceItemsS1 <- varNames %>%
  filter(
    aux == -1,
    studyS1 == "S1"
  ) %>%
  select(varNam) %>%
  pull %>%
  append(., gsub(".pre|.post|_calc", "", varNamIndicesS1)) %>%
  unique

varNamS123MI <- c(varNamCore, varNamNewAll, varNamS123Aux)
varNamS1MI <- c(varNamCore, varNamIndicesS1, varNamS1Aux[!varNamS1Aux %in% varNamIndiceItemsS1]) #
varNamS2MI <- c(varNamCore, varNamNewS2, varNamS2Aux)
varNamS3MI <- c(varNamCore, varNamNewS3, varNamS3Aux)

varNamS123PCA <- c(varNamCore, varNamS123PCA[!varNamS123PCA %in% varNamOut])
varNamS1PCA <- c(varNamCore, varNamNewS1, varNamS1PCA[!varNamS1PCA %in% varNamOut])
varNamS2PCA <- c(varNamCore, varNamNewS2, varNamS2PCA[!varNamS2PCA %in% varNamOut])
varNamS3PCA <- c(varNamCore, varNamNewS3, varNamS3PCA[!varNamS3PCA %in% varNamOut])

varNamS123MIPsbl <- c(
  paste(varNamS123MI, rep(".pre", length(varNamS123MI)), sep = ""),
  varNamS123MI,
  paste(varNamS123MI, rep(".post", length(varNamS123MI)), sep = "")
)

varNamS123MiRed <- Reduce(
  intersect,
  list(
    dtS1Red %>% select(PID, TID, TIDnum, any_of(varNamS123MIPsbl)) %>% names,
    dtS2Red %>% select(PID, TID, TIDnum, any_of(varNamS123MIPsbl)) %>% names,
    dtS3Red %>% select(PID, TID, TIDnum, any_of(varNamS123MIPsbl)) %>% names
  )
)

idVars <- c("ID", "PID", "TID", "TIDnum", "date", "week", "study")
# ID Variables (just to re-iterate)
idVars <- idVars

# Common variables across studies 
varNamS123 <- varNamS123PCA[!varNamS123PCA %in% idVars]

# Variable Groups
# varNames %>%
#   filter(pca != 0) %>%
#   mutate(contactSpecific = recode(.$contactSpecific, 
#                          `-1`="No Interaction Only",
#                          `0`="unspecific",
#                          `1`="Interaction Only")) %>%
#   crosstable::crosstable(., varGroup, by=contactSpecific) %>%
#   select(-c(.id, label)) %>%
#   kbl(.,
#       escape = FALSE,
#       booktabs = T,
#       align = c("l", "r", "c"),
#       digits=2,
#       caption = "Full Analysis: Variable Groups by Interaction Types") %>%
#   kable_classic(
#     full_width = F,
#     lightable_options = "hover",
#     html_font = "Cambria"
#   )
# 
# varNames %>%
#   filter(
#     pca != 0
#   ) %>%
#   mutate(contactSpecific = recode(.$contactSpecific, 
#                          `-1`="No Interaction Only",
#                          `0`="unspecific",
#                          `1`="Interaction Only")) %>%
#   select(varNam, varGroup, contactSpecific) %>%
#   group_by(varGroup, varNam, contactSpecific) %>%
#   summarise(n = n()) %>%
#   pivot_wider(names_from = c("varGroup", "varNam"), values_from = n, names_sep=" - ") %>%
#   ungroup %>%
#   t %>%
#   as.data.frame %>%
#   janitor::row_to_names(1) %>%
#   replace(is.na(.), 0) %>%
#   tibble::rownames_to_column(., var = "variable") %>%
#   separate(variable, c("concept", "variable"), " - ") %>%
#   arrange(concept, unspecific, `Interaction Only`) %>%
#   mutate_all(~recode(.x, `0`="", ` 1`="✓")) %>%
#   kbl(.,
#       escape = FALSE,
#       booktabs = T,
#       align = c("l", "l", rep("c", ncol(.)-2)),
#       digits=2,
#       caption = "All Possible Variables by Interaction Types") %>%
#   kable_classic(
#     full_width = F,
#     lightable_options = "hover",
#     html_font = "Cambria"
#   ) %>%
#   scroll_box(width = "100%", height = "500px")

# Non-Interaction Specific Variables
varNamS123NoInt <- varNames %>%
  filter(
    varNam %in% varNamS123PCA,
    contactSpecific == 0
  ) %>%
  select(varNam) %>%
  pull

# Interaction Specific Variables
varNamS123Int <- varNames %>%
  filter(
    varNam %in% varNamS123PCA,
    contactSpecific == 1
  ) %>%
  select(varNam) %>%
  pull

# S1 variables
varNamS1Clust <- varNamS1PCA[!varNamS1PCA %in% idVars]

# S1 Non-Interaction Specific Variables
varNamS1NoInt <- varNames %>%
  filter(
    varNam %in% varNamS1Clust,
    contactSpecific == 0
  ) %>%
  select(varNam) %>%
  pull

# S1 Interaction Specific Variables
varNamS1Int <- varNames %>%
  filter(
    varNam %in% varNamS1Clust,
    contactSpecific == 1
  ) %>%
  select(varNam) %>%
  pull


# S2 variables
varNamS2Clust <- varNamS2PCA[!varNamS2PCA %in% idVars]

# S2 Non-Interaction Specific Variables
varNamS2NoInt <- varNames %>%
  filter(
    varNam %in% varNamS2Clust,
    contactSpecific == 0
  ) %>%
  select(varNam) %>%
  pull

# S2 Interaction Specific Variables
varNamS2Int <- varNames %>%
  filter(
    varNam %in% varNamS2Clust,
    contactSpecific == 1
  ) %>%
  select(varNam) %>%
  pull

# S3 variables
varNamS3Clust <- varNamS3PCA[!varNamS3PCA %in% idVars]

# S3 Non-Interaction Specific Variables
varNamS3NoInt <- varNames %>%
  filter(
    varNam %in% varNamS3Clust,
    contactSpecific == 0
  ) %>%
  select(varNam) %>%
  pull

# S3 Interaction Specific Variables
varNamS3Int <- varNames %>%
  filter(
    varNam %in% varNamS3Clust,
    contactSpecific == 1
  ) %>%
  select(varNam) %>%
  pull

We also see that a number of variables are specific to interactions. These variables will by their very nature have substantially larger missingness (because not every measurement occasion will follow new social interactions) and these variables are also un-imputable in traditional time-series modeling and hypothesis testing procedures.

varNames %>%
  filter(
    pca != 0,
    varNam %in% c(varNamS123PCA, varNamS1PCA, varNamS2PCA, varNamS3PCA)
  ) %>%
  mutate(
    contactSpecific = recode(
      .$contactSpecific,
      `-1` = "No Interaction Only",
      `0` = "unspecific",
      `1` = "Interaction Only"
    ),
    study1 = ifelse(!is.na(studyS1), 1, 0),
    study2 = ifelse(!is.na(studyS2), 1, 0),
    study3 = ifelse(!is.na(studyS3), 1, 0)
  ) %>% 
  select(varNam, varGroup, contactSpecific, study1, study2, study3) %>%
  group_by(varGroup, varNam, contactSpecific, study1, study2, study3) %>%
  summarise(n = n()) %>%
  pivot_wider(names_from = c("varGroup", "varNam", "study1", "study2", "study3"), values_from = n, names_sep=" - ") %>%
  ungroup %>%
  t %>%
  as.data.frame %>%
  janitor::row_to_names(1) %>%
  replace(is.na(.), 0) %>%
  tibble::rownames_to_column(., var = "variable") %>%
  separate(variable, c("concept", "variable", "study1", "study2", "study3"), " - ") %>%
  mutate(across(c(study1, study2, study3), as.numeric)) %>%
  arrange(concept, unspecific, `Interaction Only`) %>% 
  mutate_all(~recode(.x, `0`="", ` 1`="✓")) %>%
  relocate(starts_with("study"), .after = last_col()) %>%
  rename_with(., ~ gsub("study", "Study ", .x, fixed = TRUE)) %>%
  kbl(.,
      escape = FALSE,
      booktabs = T,
      align = c("l", "l", rep("c", ncol(.)-2)),
      digits=2,
      caption = "Variables by Interaction Types and Study Availability") %>%
  add_header_above(c(" " = 2, "Contact Type" = 2, "Study Availability" = 3)) %>%
  kable_classic(
    full_width = F,
    lightable_options = "hover",
    html_font = "Cambria"
  )
(#tab:variable names by response type and study)Variables by Interaction Types and Study Availability
Contact Type
Study Availability
concept variable unspecific Interaction Only Study 1 Study 2 Study 3
acculturation AttitudesDutch
acculturation AttitudesPartner
contactQuality InteractionContextAccidental
contactQuality InteractionContextCooperative
contactQuality InteractionContextEqualStatus
contactQuality InteractionContextRepresentativeNL
contactQuality InteractionContextvoluntary
contactQuality qualityEffective
contactQuality qualityImportance
contactQuality qualityMeaning
contactQuality qualityOverall
contactQuality qualityStar
emotion afraid
emotion angry
emotion energy
emotion exWB
emotion lonelyAlways
needs DaytimeNeedFulfillment
needs DaytimeNeedImportance
needs KeyNeedFulfillment
needs KeyNeedImp
needs StudentGoal01
needs StudentGoal02
needs StudentGoal03
needs StudentGoal04
needs StudentGoal05
needs StudentGoal06
needs StudentGoal07
needs StudentGoal08
needs StudentGoal09
needs StudentGoal10
needs autonomy
needs competence
needs KeyNeedDueToPartner
needs KeyNeedShared

Please note that not all variables are included in the main analysis, as some variables are only found within specific studies.

Feature Extraction

Time-series can be described with a plethora of features. A good example is the list of 100 time-series features that one can extract with tsfresh python package. In practice there are usually two steps to the feature engineering process. (1) Feature extraction, that is summarizing the time series in meaningful descriptors, and (2) feature selection, the process of ensuring that only meaningful features are included in the clustering step. For the interpretability of our clustering procedure we have made a pre-selection of features, we wish to include to describe our time-series:

  1. central tendency
    • mean ✓
    • median ✓
  2. variation around the central tendency (i.e., density)
    • SD ✓
    • MAD ✓
  3. (in)stability
    • root mean square of successive differences (rmssd) ✓
    • mean absolute change (mac) ✓
  4. inertia
    • lag-1 autocorrelation ✓
    • periodicity (lag-2 & lag-14 autocorrelation) ✓
  5. linear trend
    • OLS regression parameter ✓
  6. non-linear trend
    • GAM edf ✓

(!discuss NA procedures!)

load("data/features/featOut.RData")

Across Studies

We begin by extracting the features for the main analysis that combines the sample of the three studies. We do this across all selected variables as well as for the content (non-)specific variables separately. During the feature extraction step there can at times be features that cannot be calculated for a small number of participants. An example would a participant who never filled in two consecutive measurements that describe an interaction. In that case, we cannot extract an auto correlation of lag-1 for some of the interaction specific variables.

# varNames
#items <- varNamS123PCA[!varNamS123PCA %in% idVars]

# Joined Dataset of all three studies
featData <- rbind(
  dtS1Red %>% select(any_of(varNamS123MiRed)) %>% mutate(study = "S1") %>%
    mutate(across(!TID & !study, as.numeric)),
  dtS2Red %>% select(any_of(varNamS123MiRed)) %>% mutate(study = "S2"),
  dtS3Red %>% select(any_of(varNamS123MiRed)) %>% mutate(study = "S3")
) %>%
  group_by(study, PID) %>%
  mutate(ID = cur_group_id()) %>%
  ungroup %>%
  mutate(date = as.Date(gsub(" .*", "", TID)),
         week = strftime(date, format = "%Y-W%V")) %>%
  select(ID,
         PID,
         study,
         date,
         week,
         TIDnum,
         any_of(varNamS123PCA)) %>%
   mutate(
     across(all_of(varNamS123PCA), ~ lag(.x, n = 1), .names = "{col}_lag1"),
     across(all_of(varNamS123PCA), ~ lag(.x, n = 2), .names = "{col}_lag2"),
     across(all_of(varNamS123PCA), ~ lag(.x, n = 14), .names = "{col}_lag14")
   ) %>%
  arrange(ID, TIDnum) %>%
  select_if(~ sum(!is.na(.)) > 1) %>% # only include variables that have any data (i.e., not all NA)
  as.data.frame

# apply(dtS1Red, 2, sum(is.na(.))/nrow(.))
# 
# your_dataframe %>%
#   group_by(Your_Participantid) %>%
#   summarise(across(everything(), funs(100*mean(is.na(.)))))


# Don't re-run unless you have a few hours to spare!
# featFull <-
#   featureExtractor(
#     data = featData,
#     pid = "ID",
#     tid = "TIDnum",
#     items = varNamS123
#   )
# 
# featFullContact <-
#   featureExtractor(
#     data = featData,
#     pid = "ID",
#     tid = "TIDnum",
#     items = varNamS123Int
#   )
# 
# featFullNoContact <-
#   featureExtractor(
#     data = featData,
#     pid = "ID",
#     tid = "TIDnum",
#     items = varNamS123NoInt
#   )
# 
# 
# featFull$features <- featFull$features %>%
#     filter(
#       ID != 19
#     )


pMissFull <- pMissFeat(
  all = featFull$features,
  contact = featFullContact$features,
  nocontact = featFullNoContact$features,
  title = "Feature-wise Missingess Across all Studies"
)

pMissFull$pMissPlot

# featFullImp <- featureImputer(featFull)
# featFullNoContactImp <- featureImputer(featFullNoContact)
# featFullContactImp <- featureImputer(featFullContact)

For the full dataset across the three studies, we find that about 1.66% of the extracted features are missing across the 156 participants and 145 features. These missing features are imputed with a single predictive mean matching imputation using the MICE library.

Study 1

We then repeat the feature extraction procedure for all selected variables that are specific to Study 1.

# varNames
#items <- varNamS1Clust

# Prepare Dataframe
featDataS1 <- 
  dtS1Red %>%
  mutate(date = as.Date(gsub(" .*", "", TID)),
         week = strftime(date, format = "%Y-W%V")) %>%
  select(PID,
         date,
         week,
         TIDnum,
         any_of(varNamS1Clust)) %>%
   mutate(
     across(all_of(varNamS1Clust), ~ lag(.x, n = 1), .names = "{col}_lag1"),
     across(all_of(varNamS1Clust), ~ lag(.x, n = 2), .names = "{col}_lag2"),
     across(all_of(varNamS1Clust), ~ lag(.x, n = 14), .names = "{col}_lag14")
   ) %>%
  arrange(PID, TIDnum) %>%
  select_if(~ sum(!is.na(.)) > 1) %>% # only include variables that have any data (i.e., not all NA)
  as.data.frame

# Don't re-run unless you have a few hours to spare!
# featS1 <-
#   featureExtractor(
#     data = featDataS1,
#     pid = "PID",
#     tid = "TIDnum",
#     items = varNamS1Clust
#   )
# 
# featS1Contact <-
#   featureExtractor(
#     data = featDataS1,
#     pid = "PID",
#     tid = "TIDnum",
#     items = varNamS1Int
#   )
# 
# featS1NoContact <-
#   featureExtractor(
#     data = featDataS1,
#     pid = "PID",
#     tid = "TIDnum",
#     items = varNamS1NoInt
#   )

pMissS1 <- pMissFeat(
  all = featS1$features,
  contact = featS1Contact$features,
  nocontact = featS1NoContact$features,
  title = "Feature-wise Missingess Study 1"
)

pMissS1$pMissPlot

# featS1Imp <- featureImputer(featS1)
# featS1NoContactImp <- featureImputer(featS1NoContact)
# featS1ContactImp <- featureImputer(featS1Contact)

Study 2

In the same manner, the features are extracted for the variables that are specific to Study 2.

# varNames
#items <- varNamS2Clust

# Prepare Dataframe
featDataS2 <- 
  dtS2Red %>%
  mutate(date = as.Date(gsub(" .*", "", TID)),
         week = strftime(date, format = "%Y-W%V")) %>%
  select(PID,
         date,
         week,
         TIDnum,
         any_of(varNamS2Clust)) %>%
   mutate(
     across(all_of(varNamS2Clust), ~ lag(.x, n = 1), .names = "{col}_lag1"),
     across(all_of(varNamS2Clust), ~ lag(.x, n = 2), .names = "{col}_lag2"),
     across(all_of(varNamS2Clust), ~ lag(.x, n = 14), .names = "{col}_lag14")
   ) %>%
  arrange(PID, TIDnum) %>%
  select_if(~ sum(!is.na(.)) > 1) %>% # only include variables that have any data (i.e., not all NA)
  as.data.frame

# Don't re-run unless you have a few hours to spare!
# featS2 <-
#   featureExtractor(
#     data = featDataS2,
#     pid = "PID",
#     tid = "TIDnum",
#     items = varNamS2Clust
#   )
# 
# featS2Contact <-
#   featureExtractor(
#     data = featDataS2,
#     pid = "PID",
#     tid = "TIDnum",
#     items = varNamS2Int
#   )
# 
# featS2NoContact <-
#   featureExtractor(
#     data = featDataS2,
#     pid = "PID",
#     tid = "TIDnum",
#     items = varNamS2NoInt
#   )

pMissS2 <- pMissFeat(
  all = featS2$features,
  contact = featS2Contact$features,
  nocontact = featS2NoContact$features,
  title = "Feature-wise Missingess Study 2"
)

pMissS2$pMissPlot

# featS2Imp <- featureImputer(featS2)
# featS2NoContactImp <- featureImputer(featS2NoContact)
# featS2ContactImp <- featureImputer(featS2Contact)

Study 3

And finally, we extract the features for the Study 3 specific variables.

# varNames
#items <- varNamS3Clust

# Prepare Dataframe
featDataS3 <- 
  dtS3Red %>%
  mutate(date = as.Date(gsub(" .*", "", TID)),
         week = strftime(date, format = "%Y-W%V")) %>%
  select(PID,
         date,
         week,
         TIDnum,
         any_of(varNamS3Clust)) %>%
   mutate(
     across(all_of(varNamS3Clust), ~ lag(.x, n = 1), .names = "{col}_lag1"),
     across(all_of(varNamS3Clust), ~ lag(.x, n = 2), .names = "{col}_lag2"),
     across(all_of(varNamS3Clust), ~ lag(.x, n = 14), .names = "{col}_lag14")
   ) %>%
  arrange(PID, TIDnum) %>%
  select_if(~ sum(!is.na(.)) > 1) %>% # only include variables that have any data (i.e., not all NA)
  as.data.frame

# Don't re-run unless you have a few hours to spare!
# featS3 <-
#   featureExtractor(
#     data = featDataS3,
#     pid = "PID",
#     tid = "TIDnum",
#     items = varNamS3Clust
#   )
# 
# featS3Contact <-
#   featureExtractor(
#     data = featDataS3,
#     pid = "PID",
#     tid = "TIDnum",
#     items = varNamS3Int
#   )
# 
# featS3NoContact <-
#   featureExtractor(
#     data = featDataS3,
#     pid = "PID",
#     tid = "TIDnum",
#     items = varNamS3NoInt
#   )

pMissS3 <- pMissFeat(
  all = featS3$features,
  contact = featS3Contact$features,
  nocontact = featS3NoContact$features,
  title = "Feature-wise Missingess Study 3"
)
pMissS3$pMissPlot

# featS3Imp <- featureImputer(featS3)
# featS3NoContactImp <- featureImputer(featS3NoContact)
# featS3ContactImp <- featureImputer(featS3Contact)
# 
# save(list = ls(pattern = "feat"), file = "data/features/featOut.RData")

Feature Reduction

To avoid the dimensionality curse we reduce the extracted features using a principal component analysis.

MORE INFO NEEDED

raw_data <- featData
z_data <- featFullImp$featuresImpZ
scaled_data <- featFullImp$featuresImpZMat

res.pca <- prcomp(scaled_data, scale = FALSE)
fviz_eig(res.pca, addlabels = TRUE)

# var <- get_pca_var(res.pca)
# corrplot::corrplot(var$contrib[,1:10], is.corr=FALSE) 
fviz_contrib(res.pca, choice = "var", axes = 1, top = 50)

fviz_contrib(res.pca, choice = "var", axes = 2, top = 50)

res.desc <-
  FactoMineR::dimdesc(
    FactoMineR::PCA(scaled_data, scale.unit = FALSE, graph = FALSE),
    axes = c(1, 2),
    proba = 0.05
  )
# Description of dimension 1
# res.desc$Dim.1

plot_ly(
  res.pca$rotation %>% as.data.frame,
  x = ~ PC1,
  y = ~ PC2,
  z = ~ PC3,
  size = 2,
  type = 'scatter3d',
  mode = 'markers',
  text = ~ paste('Variable:', rownames(res.pca$rotation))
) %>%
  layout(title = 'Variables in reduced space')
plot_ly(
  res.pca$x %>% as.data.frame,
  x = ~ PC1,
  y = ~ PC2,
  z = ~ PC3,
  size = 2,
  type = 'scatter3d',
  mode = 'markers',
  text = ~ paste('Participant:', rownames(res.pca$x))
) %>%
  layout(title = 'Participants in reduced space')
pca.out <- as.data.frame(res.pca$x[,1:3])

# load libraries
library(factoextra)
library(NbClust)
# elbow method
fviz_nbclust(pca.out, kmeans, method = "wss") +
  geom_vline(xintercept = 2, linetype = 2)+
  labs(subtitle = "Elbow method")

# Silhouette method
fviz_nbclust(pca.out, kmeans, method = "silhouette")+
  labs(subtitle = "Silhouette method")

# Gap statistic [takes for ever]
# nboot = 50 to keep the function speedy.
# recommended value: nboot= 500 for your analysis.
# Use verbose = FALSE to hide computing progression.
# set.seed(123)
# fviz_nbclust(scaled_data, kmeans, nstart = 100,  method = "gap_stat", nboot = 500)+
#   labs(subtitle = "Gap statistic method")

kmeansOut <- kmeans(pca.out, centers = 3, nstart = 100)
fviz_cluster(kmeansOut, geom = "point", data = scaled_data, ggtheme = theme_Publication())

# MCLUST
library(mclust)
BIC <- mclustBIC(pca.out)
plot(BIC)

summary(BIC)
## Best BIC values:
##          EEI,1 EVI,1 VEI,1
## BIC      -2502 -2502 -2502
## BIC diff     0     0     0
mod1 <- Mclust(pca.out)
summary(mod1, parameters = FALSE)
## ---------------------------------------------------- 
## Gaussian finite mixture model fitted by EM algorithm 
## ---------------------------------------------------- 
## 
## Mclust XXI (diagonal multivariate normal) model with 1 component: 
## 
##  log-likelihood   n df   BIC   ICL
##           -1236 156  6 -2502 -2502
## 
## Clustering table:
##   1 
## 156
# DBSCAN
library(dbscan)
library(fpc)

# to plot the eps values
eps_plot = kNNdistplot(pca.out, k=3)
# to draw an optimum line
eps_plot %>% abline(h = 3.5, lty = 2)

potentialMinPts <- round(SciViews::ln(nrow(pca.out)))
eps <- 3.5
minPts <- 2

res.fpc <- fpc::dbscan(scaled_data, eps=eps, MinPts=minPts, scale=FALSE, showplot=0)
res.db <- dbscan::dbscan(scaled_data, eps=eps, minPts=minPts)

resEqual.check <- all(res.fpc$cluster == res.db$cluster)
nClustDBSCAN <- length(unique(res.fpc$cluster))-1

fviz_cluster(res.fpc, scaled_data, geom = "point", ggtheme = theme_Publication())

Feature Clustering

Cluster analyses have been a staple within a variety of sciences for the better part of a century. It’s applications are wide and because most procedures fall under the “unsupervised learning” umbrella the methodological developments are fast-paced and new methods or refinements are published constantly. Among the many options available four types are found most commonly within the modern literature on clustering analyses:

  1. centroid-based
    • e.g., k-means
    • no assumptions (+)
    • fast even with large matrices (+)
    • non-probabilistic (+/-)
    • sensitive to local minima (-)
  2. distribution-based
    • e.g., gaussian mixture model (GMM)
    • flexible shape (+)
    • probabilistic (+/-)
    • (gaussian) distributions assumed (-)
  3. density-based
    • e.g., dbscan / OPTICS
    • no shape assumption (+)
    • does not assign outliers/noise (+)
  4. Hierarchical-based (not relevant)
    • e.g., agglomerative hierarchical clustering
    • best with hierarchical data (-)
    • best with small n (-)

Each clustering procedures comes with their own sets of advantages and disadvantages. We will focus mainly on the k-means procedure because it has the least assumptions and is fast even with large data sets. Additionally, the methods are well-established and the results are easy to interpret. As such, the procedure should be applicable to most users within the social sciences and for ESM feature data specifically. We offer Gaussian mixture modeling and a common density-based approach as supplementary analyses.

The main clustering procedure, uses the features calculated for the relevant variables across all three studies. For our main method, we use the centroid-based k-means clustering. The procedure needs the researcher to make a selection on the optimal number of clusters in order to run the main algorithm. We use the Elbow and the Silhouette method, which both suggest two clusters to be the optimal solution.

featureExclusion <- c(
  "mean",
  "sd",
  "rmssd",
  "ar02",
  "edf_ar"
)

# prepare data for main analysis
raw_data <- featData
z_data <- featFullImp$featuresImpZ %>% select(-ends_with(featureExclusion))
scaled_data <- featFullImp$featuresImpZMat %>% select(-ends_with(featureExclusion))

# load libraries
library(factoextra)
library(NbClust)

# Elbow method
fviz_nbclust(scaled_data, kmeans, method = "wss") +
  geom_vline(xintercept = 2, linetype = 2)+
  labs(subtitle = "Elbow method")

# Silhouette method
fviz_nbclust(scaled_data, kmeans, method = "silhouette")+
  labs(subtitle = "Silhouette method")

# Gap statistic [takes for ever]
# nboot = 50 to keep the function speedy. 
# recommended value: nboot= 500 for your analysis.
# Use verbose = FALSE to hide computing progression.
# set.seed(123)
# fviz_nbclust(scaled_data, kmeans, nstart = 100,  method = "gap_stat", nboot = 500)+
#   labs(subtitle = "Gap statistic method")

We use this parameter to run the actual k-means cluster analysis, during which the algorithm iteratively seeks to optimally separate the participants into two clusters based on their feature values. During the iterative process the algorithm might at times stop at a non-optimal solution (i.e., local minima). To avoid this drawback and to find the (globally) optimal solution we let the algorithm run with 100 separate staring positions.

kmeansOut <- kmeans(scaled_data, centers = 2, nstart = 100)

Because the clustering happens in a multidimensional space of the 145 features, we begin by visualizing the data in a two-dimensional space, where we encircle the points of the clusters (i.e., convex hulls) for the first two dimensions of a principle component analysis.

fviz_cluster(kmeansOut, geom = "point", data = scaled_data, ggtheme = theme_Publication())

We then inspect the cluster-averages of all feature for each variable. We (1) see that for some variables the features are generally stronger in separating the clusters (e.g., how cooperative an interaction was) than for other variables (e.g., Attitudes towards the Dutch). Additionally, we see that (2) some within the variables some features are better at distinguishing clusters (e.g., mean and median of well-being) than others (e.g., sd and rmssd of well-being).

IMPORTANT FIX: https://stackoverflow.com/questions/66448838/add-an-interactive-button-to-switch-which-variable-is-mapped-to-fill-in-ggplotly

data.frame(ID = as.numeric(names(kmeansOut$cluster)), cluster = kmeansOut$cluster) %>%
  merge(., z_data) %>%
  group_by(cluster) %>%
  summarize_all(mean) %>%
  ungroup %>%
  select(-ID) %>% 
  reshape2::melt(id.vars = "cluster") %>% 
  mutate(lab = variable) %>%
  mutate(
    lab = variable,
    variable = gsub("\\_.*", "", lab),
    feature = gsub("^.*?\\_", "", lab)
  ) %>% 
  ggplot(., aes(x = feature, y = value, group = cluster, color = as.factor(cluster))) +
  geom_point() +
  geom_line() +
  coord_flip() +
  labs(
    x = "Features",
    y = "Standardized Mean",
    color = "Cluster"
  ) +
  facet_wrap(~ variable) +
  theme_Publication()

Next, we inspect the cluster-averages of all variables for each feature. This is the same data as in the plot above. However, here we see more clearly that some features are better at distinguishing the clusters across variables (e.g., mean and median) than others (e.g., auto correlations).

data.frame(ID = as.numeric(names(kmeansOut$cluster)), cluster = kmeansOut$cluster) %>%
  merge(., z_data) %>%
  group_by(cluster) %>%
  summarize_all(mean) %>%
  ungroup %>%
  select(-ID) %>% 
  reshape2::melt(id.vars = "cluster") %>% 
  mutate(
    lab = variable,
    variable = gsub("\\_.*", "", lab),
    feature = gsub("^.*?\\_", "", lab)
  ) %>% 
  ggplot(., aes(x = variable, y = value, group = cluster, color = as.factor(cluster))) +
  geom_point() +
  geom_line() +
  coord_flip() +
  labs(
    x = "Features",
    y = "Standardized Mean",
    color = "Cluster"
  ) +
  facet_wrap(~ feature) +
  theme_Publication()

In a final step we visualize the raw time series for each variable and add the average cluster development to see the features in action.

data.frame(ID = as.numeric(names(kmeansOut$cluster)), cluster = kmeansOut$cluster) %>%
  merge(., raw_data) %>%
  select(
    ID,
    TIDnum,
    cluster,
    any_of(varNamS123)
  ) %>%
  reshape2::melt(id.vars = c("cluster", "ID","TIDnum")) %>% 
  ggplot(., aes(x=TIDnum, y=value, group=cluster, color=as.factor(cluster))) +
  geom_line(aes(x=TIDnum, y=value, group=ID, color=as.factor(cluster)), alpha=0.05) +
  stat_summary(fun=mean, geom="line") +
  facet_wrap(~ variable, scales = "free_y") +
  labs(
    x = "Time ID",
    y = "Response (Mean Cluster Response Bold)",
    color = "Cluster"
  ) +
  theme_Publication()

data.frame(ID = as.numeric(names(kmeansOut$cluster)), cluster = kmeansOut$cluster) %>%
  merge(., raw_data) %>%
  select(
    ID,
    TIDnum,
    cluster,
    any_of(varNamS123)
  ) %>%
  reshape2::melt(id.vars = c("cluster", "ID","TIDnum")) %>% 
  ggplot(., aes(x=TIDnum, y=value, group=cluster, color=as.factor(cluster))) +
  geom_line(aes(x=TIDnum, y=value, group=ID, color=as.factor(cluster)), alpha=0.05) +
  geom_smooth(aes(group=cluster)) +
  #stat_summary(fun=mean, geom="line") +
  facet_wrap(~ variable, scales = "free_y") +
  labs(
    x = "Time ID",
    y = "Response (Mean Cluster Response Bold)",
    color = "Cluster"
  ) +
  theme_Publication()

Software Information

The full session information with all relevant system information and all loaded and installed packages is available in the collapsible section below.

System Info

Table 8: R environment session info for reproducibility of results
Setting Value
version R version 4.3.0 (2023-04-21)
os macOS Ventura 13.4.1
system x86_64, darwin20
ui X11
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz Europe/Amsterdam
date 2023-07-26
pandoc 3.1.3 @ /usr/local/bin/ (via rmarkdown)


Package Info

Table 9: Package info for reproducibility of results
Package Loaded version Date Source
Amelia 1.8.1 2022-11-19 CRAN (R 4.3.0)
anytime 0.3.9 2020-08-27 CRAN (R 4.3.0)
bookdown 0.34 2023-05-09 CRAN (R 4.3.0)
brms 2.19.0 2023-03-14 CRAN (R 4.3.0)
data.table 1.14.8 2023-02-17 CRAN (R 4.3.0)
dbscan 1.1-11 2022-10-27 CRAN (R 4.3.0)
DescTools 0.99.48 2023-02-19 CRAN (R 4.3.0)
devtools 2.4.5 2022-10-11 CRAN (R 4.3.0)
dplyr 1.1.2 2023-04-20 CRAN (R 4.3.0)
dygraphs 1.1.1.6 2018-07-11 CRAN (R 4.3.0)
ellipse 0.4.5 2023-04-05 CRAN (R 4.3.0)
factoextra 1.0.7 2020-04-01 CRAN (R 4.3.0)
fpc 2.2-10 2023-01-07 CRAN (R 4.3.0)
ggpattern 1.0.1 2022-11-09 CRAN (R 4.3.0)
ggplot2 3.4.2 2023-04-03 CRAN (R 4.3.0)
ggthemes 4.2.4 2021-01-20 CRAN (R 4.3.0)
gratia 0.8.1 2023-02-02 CRAN (R 4.3.0)
gridExtra 2.3 2017-09-09 CRAN (R 4.3.0)
gtsummary 1.7.1 2023-04-27 CRAN (R 4.3.0)
haven 2.5.2 2023-02-28 CRAN (R 4.3.0)
Hmisc 5.1-0 2023-05-08 CRAN (R 4.3.0)
jtools 2.2.1 2022-12-02 CRAN (R 4.3.0)
kableExtra 1.3.4 2021-02-20 CRAN (R 4.3.0)
Kendall 2.2.1 2022-03-20 CRAN (R 4.3.0)
knitr 1.42 2023-01-25 CRAN (R 4.3.0)
lme4 1.1-33 2023-04-25 CRAN (R 4.3.0)
lubridate 1.9.2 2023-02-10 CRAN (R 4.3.0)
mada 0.5.11 2022-07-15 CRAN (R 4.3.0)
MASS 7.3-58.4 2023-03-07 CRAN (R 4.3.0)
Matrix 1.5-4 2023-04-04 CRAN (R 4.3.0)
mclust 6.0.0 2022-10-31 CRAN (R 4.3.0)
metadat 1.2-0 2022-04-06 CRAN (R 4.3.0)
metafor 4.2-0 2023-05-08 CRAN (R 4.3.0)
mgcv 1.8-42 2023-03-02 CRAN (R 4.3.0)
mgcViz 0.1.9 2021-10-05 CRAN (R 4.3.0)
modifiedmk 1.6 2021-06-10 CRAN (R 4.3.0)
mvmeta 1.0.3 2019-12-10 CRAN (R 4.3.0)
mvtnorm 1.1-3 2021-10-08 CRAN (R 4.3.0)
NbClust 3.0.1 2022-05-02 CRAN (R 4.3.0)
nlme 3.1-162 2023-01-31 CRAN (R 4.3.0)
numDeriv 2016.8-1.1 2019-06-06 CRAN (R 4.3.0)
pander 0.6.5 2022-03-18 CRAN (R 4.3.0)
papaja 0.1.1 2022-07-05 CRAN (R 4.3.0)
plotly 4.10.1 2022-11-07 CRAN (R 4.3.0)
plyr 1.8.8 2022-11-11 CRAN (R 4.3.0)
psych 2.3.3 2023-03-18 CRAN (R 4.3.0)
purrr 1.0.1 2023-01-10 CRAN (R 4.3.0)
qgam 1.3.4 2021-11-22 CRAN (R 4.3.0)
RColorBrewer 1.1-3 2022-04-03 CRAN (R 4.3.0)
Rcpp 1.0.10 2023-01-22 CRAN (R 4.3.0)
readxl 1.4.2 2023-02-09 CRAN (R 4.3.0)
remedy 0.1.0 2018-12-03 CRAN (R 4.3.0)
reshape 0.8.9 2022-04-12 CRAN (R 4.3.0)
reshape2 1.4.4 2020-04-09 CRAN (R 4.3.0)
rmarkdown 2.21 2023-03-26 CRAN (R 4.3.0)
sessioninfo 1.2.2 2021-12-06 CRAN (R 4.3.0)
shiny 1.7.4 2022-12-15 CRAN (R 4.3.0)
stringi 1.7.12 2023-01-11 CRAN (R 4.3.0)
stringr 1.5.0 2022-12-02 CRAN (R 4.3.0)
ThreeWay 1.1.3 2015-09-07 CRAN (R 4.3.0)
tibble 3.2.1 2023-03-20 CRAN (R 4.3.0)
tidyr 1.3.0 2023-01-24 CRAN (R 4.3.0)
tinylabels 0.2.3 2022-02-06 CRAN (R 4.3.0)
usethis 2.1.6 2022-05-25 CRAN (R 4.3.0)


Full Session Info (including loaded but unattached packages — for troubleshooting only)

R version 4.3.0 (2023-04-21)

Platform: x86_64-apple-darwin20 (64-bit)

locale: en_US.UTF-8||en_US.UTF-8||en_US.UTF-8||C||en_US.UTF-8||en_US.UTF-8

attached base packages:

  • grid
  • stats
  • graphics
  • grDevices
  • datasets
  • utils
  • methods
  • base

other attached packages:

  • fpc(v.2.2-10)
  • dbscan(v.1.1-11)
  • mclust(v.6.0.0)
  • NbClust(v.3.0.1)
  • shiny(v.1.7.4)
  • mgcViz(v.0.1.9)
  • qgam(v.1.3.4)
  • modifiedmk(v.1.6)
  • Kendall(v.2.2.1)
  • mgcv(v.1.8-42)
  • gratia(v.0.8.1)
  • DescTools(v.0.99.48)
  • ThreeWay(v.1.1.3)
  • Amelia(v.1.8.1)
  • factoextra(v.1.0.7)
  • reshape(v.0.8.9)
  • readxl(v.1.4.2)
  • dygraphs(v.1.1.1.6)
  • purrr(v.1.0.1)
  • lubridate(v.1.9.2)
  • anytime(v.0.3.9)
  • reshape2(v.1.4.4)
  • stringi(v.1.7.12)
  • stringr(v.1.5.0)
  • papaja(v.0.1.1)
  • tinylabels(v.0.2.3)
  • kableExtra(v.1.3.4)
  • Hmisc(v.5.1-0)
  • tidyr(v.1.3.0)
  • dplyr(v.1.1.2)
  • plyr(v.1.8.8)
  • data.table(v.1.14.8)
  • mada(v.0.5.11)
  • metafor(v.4.2-0)
  • numDeriv(v.2016.8-1.1)
  • metadat(v.1.2-0)
  • mvmeta(v.1.0.3)
  • ellipse(v.0.4.5)
  • mvtnorm(v.1.1-3)
  • devtools(v.2.4.5)
  • usethis(v.2.1.6)
  • pander(v.0.6.5)
  • tibble(v.3.2.1)
  • sessioninfo(v.1.2.2)
  • gtsummary(v.1.7.1)
  • jtools(v.2.2.1)
  • nlme(v.3.1-162)
  • lme4(v.1.1-33)
  • Matrix(v.1.5-4)
  • ggpattern(v.1.0.1)
  • gridExtra(v.2.3)
  • plotly(v.4.10.1)
  • RColorBrewer(v.1.1-3)
  • haven(v.2.5.2)
  • ggthemes(v.4.2.4)
  • ggplot2(v.3.4.2)
  • psych(v.2.3.3)
  • brms(v.2.19.0)
  • Rcpp(v.1.0.10)
  • MASS(v.7.3-58.4)
  • bookdown(v.0.34)
  • remedy(v.0.1.0)
  • knitr(v.1.42)
  • rmarkdown(v.2.21)

loaded via a namespace (and not attached):

  • sjmisc(v.2.8.9)
  • gld(v.2.6.6)
  • urlchecker(v.1.0.1)
  • nnet(v.7.3-18)
  • shinythemes(v.1.2.0)
  • DT(v.0.27)
  • rstan(v.2.21.8)
  • vctrs(v.0.6.2)
  • effectsize(v.0.8.3)
  • digest(v.0.6.31)
  • proxy(v.0.4-27)
  • Exact(v.3.2)
  • polycor(v.0.8-1)
  • ggrepel(v.0.9.3)
  • bayestestR(v.0.13.1)
  • renv(v.0.15.5)
  • horst(v.0.1)
  • httpuv(v.1.6.11)
  • foreach(v.1.5.2)
  • ltm(v.1.2-0)
  • withr(v.2.5.0)
  • xfun(v.0.39)
  • ggpubr(v.0.6.0)
  • ellipsis(v.0.3.2)
  • survival(v.3.5-5)
  • memoise(v.2.0.1)
  • diptest(v.0.76-0)
  • janitor(v.2.2.0)
  • msm(v.1.7)
  • emmeans(v.1.8.6)
  • profvis(v.0.3.8)
  • parameters(v.0.21.0)
  • systemfonts(v.1.0.4)
  • zoo(v.1.8-12)
  • gtools(v.3.9.4)
  • DEoptimR(v.1.0-14)
  • prabclus(v.2.3-2)
  • Formula(v.1.2-5)
  • GGally(v.2.1.2)
  • prettyunits(v.1.1.1)
  • datawizard(v.0.7.1)
  • rematch2(v.2.1.2)
  • promises(v.1.2.0.1)
  • scatterplot3d(v.0.3-44)
  • httr(v.1.4.6)
  • rstatix(v.0.7.2)
  • ps(v.1.7.5)
  • rstudioapi(v.0.14)
  • miniUI(v.0.1.1.1)
  • generics(v.0.1.3)
  • base64enc(v.0.1-3)
  • processx(v.3.8.1)
  • ggeffects(v.1.2.2)
  • FactoMineR(v.2.8)
  • threejs(v.0.3.3)
  • Scale(v.1.0.4)
  • xtable(v.1.8-4)
  • doParallel(v.1.0.17)
  • evaluate(v.0.21)
  • hms(v.1.1.3)
  • colorspace(v.2.1-0)
  • flexmix(v.2.3-19)
  • magrittr(v.2.0.3)
  • snakecase(v.0.11.0)
  • readr(v.2.1.4)
  • modeltools(v.0.2-23)
  • later(v.1.3.1)
  • viridis(v.0.6.3)
  • lattice(v.0.21-8)
  • posterior(v.1.4.1)
  • robustbase(v.0.99-0)
  • matrixStats(v.0.63.0)
  • xts(v.0.13.1)
  • sjPlot(v.2.8.14)
  • class(v.7.3-21)
  • pillar(v.1.9.0)
  • StanHeaders(v.2.21.0-7)
  • performance(v.0.10.3)
  • iterators(v.1.0.14)
  • compiler(v.4.3.0)
  • minqa(v.1.2.5)
  • crayon(v.1.5.2)
  • abind(v.1.4-5)
  • chron(v.2.3-61)
  • modelr(v.0.1.11)
  • mathjaxr(v.1.6-0)
  • rootSolve(v.1.8.2.3)
  • shinystan(v.2.6.0)
  • codetools(v.0.2-19)
  • crosstalk(v.1.2.0)
  • bslib(v.0.4.2)
  • e1071(v.1.7-13)
  • lmom(v.2.9)
  • mime(v.0.12)
  • splines(v.4.3.0)
  • markdown(v.1.6)
  • cellranger(v.1.1.0)
  • leaps(v.3.1)
  • utf8(v.1.2.3)
  • fs(v.1.6.2)
  • checkmate(v.2.2.0)
  • pkgbuild(v.1.4.0)
  • gamm4(v.0.2-6)
  • admisc(v.0.31)
  • expm(v.0.999-7)
  • ggsignif(v.0.6.4)
  • estimability(v.1.4.1)
  • callr(v.3.7.3)
  • tzdb(v.0.4.0)
  • svglite(v.2.1.1)
  • bayesplot(v.1.10.0)
  • pkgconfig(v.2.0.3)
  • tools(v.4.3.0)
  • cachem(v.1.0.8)
  • viridisLite(v.0.4.2)
  • rvest(v.1.0.3)
  • fastmap(v.1.1.1)
  • scales(v.1.2.1)
  • gt(v.0.9.0)
  • broom(v.1.0.4)
  • sass(v.0.4.6)
  • patchwork(v.1.1.2)
  • coda(v.0.19-4)
  • insight(v.0.19.1)
  • carData(v.3.0-5)
  • rpart(v.4.1.19)
  • fontawesome(v.0.5.1)
  • farver(v.2.1.1)
  • yaml(v.2.3.7)
  • foreign(v.0.8-84)
  • sjstats(v.0.18.2)
  • cli(v.3.6.1)
  • stats4(v.4.3.0)
  • webshot(v.0.5.4)
  • lifecycle(v.1.0.3)
  • kernlab(v.0.9-32)
  • backports(v.1.4.1)
  • Brobdingnag(v.1.2-9)
  • timechange(v.0.2.0)
  • gtable(v.0.3.3)
  • parallel(v.4.3.0)
  • jsonlite(v.1.8.4)
  • colourpicker(v.1.2.0)
  • multcompView(v.0.1-9)
  • RcppParallel(v.5.1.7)
  • mixmeta(v.1.2.0)
  • jquerylib(v.0.1.4)
  • highr(v.0.10)
  • bridgesampling(v.1.1-2)
  • loo(v.2.6.0)
  • shinyjs(v.2.1.0)
  • distributional(v.0.3.2)
  • lazyeval(v.0.2.2)
  • htmltools(v.0.5.5)
  • sjlabelled(v.1.2.0)
  • glue(v.1.6.2)
  • broom.helpers(v.1.13.0)
  • rprojroot(v.2.0.3)
  • mnormt(v.2.1.1)
  • mvnfast(v.0.2.8)
  • SciViews(v.0.9-13.1)
  • nFactors(v.2.4.1.1)
  • boot(v.1.3-28.1)
  • flashClust(v.1.01-2)
  • igraph(v.1.4.2)
  • R6(v.2.5.1)
  • forcats(v.1.0.0)
  • labeling(v.0.4.2)
  • cluster(v.2.1.4)
  • pkgload(v.1.3.2)
  • nloptr(v.2.0.3)
  • rstantools(v.2.3.1)
  • tidyselect(v.1.2.0)
  • htmlTable(v.2.4.1)
  • tensorA(v.0.36.2)
  • xml2(v.1.3.4)
  • inline(v.0.3.19)
  • car(v.3.1-2)
  • munsell(v.0.5.0)
  • KernSmooth(v.2.23-20)
  • htmlwidgets(v.1.6.2)
  • rlang(v.1.1.1)
  • remotes(v.2.4.2)
  • fansi(v.1.0.4)




References

Kreienkamp, J., Bringmann, L. F., Engler, R. F., Jonge, P. de, & Epstude, K. (2022). The Migration Experience: A Conceptual Framework and Systematic Scoping Review of Psychological Acculturation [Manuscript submitted for publication]. Department of Psychology, University of Groningen.
Madley-Dowd, P., Hughes, R., Tilling, K., & Heron, J. (2019). The proportion of missing data should not be used to guide decisions on multiple imputation. Journal of Clinical Epidemiology, 110, 63–73. https://doi.org/10.1016/j.jclinepi.2019.02.016
Ram, N., Conroy, D. E., Pincus, A. L., Lorek, A., Rebar, A., Roche, M. J., Coccia, M., Morack, J., Feldman, J., & Gerstorf, D. (2014). Examining the Interplay of Processes Across Multiple Time-Scales: Illustration With the Intraindividual Study of Affect, Health, and Interpersonal Behavior (iSAHIB). Research in Human Development, 11(2), 142–160. https://doi.org/10.1080/15427609.2014.906739